Flutter Engine
The Flutter Engine
Functions
Canvas_getBaseLayerSize.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_getBaseLayerSize, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_getBaseLayerSize  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Canvas_getBaseLayerSize.cpp.

4 {
5void draw(SkCanvas* ) {
7 bitmap.allocPixels(SkImageInfo::MakeN32Premul(20, 30));
9 canvas.clipRect(SkRect::MakeWH(10, 40));
10 SkIRect clipDeviceBounds = canvas.getDeviceClipBounds();
11 if (clipDeviceBounds.isEmpty()) {
12 SkDebugf("Empty clip bounds is unexpected!\n");
13 }
14 SkDebugf("clip=%d,%d\n", clipDeviceBounds.width(), clipDeviceBounds.height());
15 SkISize baseLayerSize = canvas.getBaseLayerSize();
16 SkDebugf("size=%d,%d\n", baseLayerSize.width(), baseLayerSize.height());
17}
18} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
@ kUnknown_SkPixelGeometry
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
Definition: bitmap.py:1
Definition: SkRect.h:32
constexpr int32_t height() const
Definition: SkRect.h:165
constexpr int32_t width() const
Definition: SkRect.h:158
bool isEmpty() const
Definition: SkRect.h:202
Definition: SkSize.h:16
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609