Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Surface_notifyContentWillChange.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Surface_notifyContentWillChange, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Surface_notifyContentWillChange  ,
256  ,
256  ,
true  ,
 
)

Definition at line 5 of file Surface_notifyContentWillChange.cpp.

5 {
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
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)