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

Go to the source code of this file.

Functions

 REG_FIDDLE (f16to8888drawImageBug, 256, 256, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( f16to8888drawImageBug  ,
256  ,
256  ,
false  ,
 
)

Definition at line 4 of file f16to8888drawImageBug.cpp.

4 {
5// f16to8888drawImageBug
6void draw(SkCanvas* canvas) {
8
9 SkImageInfo imageInfo =
12 SkPaint p;
13 surface->getCanvas()->drawRect(SkRect::MakeXYWH(20, 20, 40, 40), p);
14
16
17 SkImageInfo imageInfo2 =
18 SkImageInfo::Make(100, 100, kN32_SkColorType, kPremul_SkAlphaType, colorSpace2);
19 sk_sp<SkSurface> surface2 = SkSurfaces::Raster(imageInfo2);
20 surface2->getCanvas()->drawImage(surface->makeImageSnapshot(), 0, 0);
21
22 canvas->drawImage(surface->makeImageSnapshot(), 0, 0);
23 canvas->drawImage(surface2->makeImageSnapshot(), 50, 0);
24}
25} // END FIDDLE
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition: SkColorType.h:38
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeSRGBLinear()
SkCanvas * getCanvas()
Definition: SkSurface.cpp:82
sk_sp< SkImage > makeImageSnapshot()
Definition: SkSurface.cpp:90
VkSurfaceKHR surface
Definition: main.cc:49
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659