Flutter Engine
The Flutter Engine
Surface_notifyContentWillChange.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(Surface_notifyContentWillChange, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
7 for (int i = 0; i < 3; ++i) {
8 SkDebugf("surface generationID: %u\n", surface->generationID());
9 if (0 == i) {
10 surface->getCanvas()->drawColor(SK_ColorBLACK);
11 } else {
12 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
13 }
14 }
15}
16} // END FIDDLE
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
REG_FIDDLE(Surface_notifyContentWillChange, 256, 256, true, 0)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
@ kDiscard_ContentChangeMode
discards surface on change
Definition: SkSurface.h:204
VkSurfaceKHR surface
Definition: main.cc:49
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)