Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
draw.cpp File Reference
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "tools/fiddle/fiddle_main.h"
#include "tools/gpu/ManagedBackendTexture.h"

Go to the source code of this file.

Functions

DrawOptions GetDrawOptions ()
 
void draw (SkCanvas *canvas)
 

Function Documentation

◆ draw()

void draw ( SkCanvas canvas)

Definition at line 35 of file draw.cpp.

35 {
36 canvas->clear(SK_ColorWHITE);
38 matrix.setScale(0.75f, 0.75f);
39 matrix.preRotate(frame * 30.0f * duration); // If an animation, rotate at 30 deg/s.
42 SkSamplingOptions(), matrix));
43 canvas->drawPaint(paint);
44 SkDebugf("This is text output: %d", 2);
45
46 if (auto dContext = GrAsDirectContext(canvas->recordingContext())) {
52 nullptr);
53
54 constexpr int kSampleCnt = 0;
58 kSampleCnt,
60 nullptr,
61 nullptr);
62
63 // Note: this surface should only be renderable (i.e., not textureable)
68 nullptr,
69 nullptr);
70 }
71}
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTopLeft_GrSurfaceOrigin
Definition GrTypes.h:148
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
constexpr SkColor SK_ColorWHITE
Definition SkColor.h:122
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
virtual GrRecordingContext * recordingContext() const
void drawPaint(const SkPaint &paint)
void clear(SkColor color)
Definition SkCanvas.h:1199
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
Definition SkImage.cpp:179
const Paint & paint
GrBackendTexture backEndTextureRenderTarget
Definition examples.cpp:27
sk_sp< SkImage > image
Definition examples.cpp:29
GrBackendRenderTarget backEndRenderTarget
Definition examples.cpp:26
GrBackendTexture backEndTexture
Definition examples.cpp:25
double duration
Definition examples.cpp:30
double frame
Definition examples.cpp:31
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258
SK_API sk_sp< SkSurface > WrapBackendRenderTarget(GrRecordingContext *context, const GrBackendRenderTarget &backendRenderTarget, GrSurfaceOrigin origin, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, RenderTargetReleaseProc releaseProc=nullptr, ReleaseContext releaseContext=nullptr)
SK_API sk_sp< SkSurface > WrapBackendTexture(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)

◆ GetDrawOptions()

DrawOptions GetDrawOptions ( )

Definition at line 16 of file draw.cpp.

16 {
17 // path *should* be absolute.
18 static const char path[] = "resources/images/color_wheel.png";
19 return DrawOptions(256,
20 256,
21 true,
22 true,
23 true,
24 true,
25 true,
26 false,
27 false,
28 path,
29 skgpu::Mipmapped::kYes,
30 64,
31 64,
32 0,
33 skgpu::Mipmapped::kYes);
34}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57