Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
4// HASH=be9574c4a14f891e1abb4ec2b1e51d6c
5REG_FIDDLE(Surface_notifyContentWillChange, 256, 256, true, 0) {
6void draw(SkCanvas* canvas) {
8 for (int i = 0; i < 3; ++i) {
9 SkDebugf("surface generationID: %u\n", surface->generationID());
10 if (0 == i) {
11 surface->getCanvas()->drawColor(SK_ColorBLACK);
12 } else {
13 surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
14 }
15 }
16}
17} // END FIDDLE
constexpr SkColor SK_ColorBLACK
Definition SkColor.h:103
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
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
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)