Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSurface_Raster.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSurface_Raster_DEFINED
9#define SkSurface_Raster_DEFINED
10
17
18#include <cstring>
19
20class SkCanvas;
21class SkCapabilities;
22class SkImage;
23class SkPaint;
24class SkPixelRef;
25class SkPixmap;
26class SkSurface;
27class SkSurfaceProps;
28struct SkIRect;
29
31public:
32 SkSurface_Raster(const SkImageInfo&, void*, size_t rb,
33 void (*releaseProc)(void* pixels, void* context), void* context,
34 const SkSurfaceProps*);
36
37 // From SkSurface.h
38 SkImageInfo imageInfo() const override { return fBitmap.info(); }
39
40 // From SkSurface_Base.h
42
43 SkCanvas* onNewCanvas() override;
45 sk_sp<SkImage> onNewImageSnapshot(const SkIRect* subset) override;
46 void onWritePixels(const SkPixmap&, int x, int y) override;
47 void onDraw(SkCanvas*, SkScalar, SkScalar, const SkSamplingOptions&, const SkPaint*) override;
48 bool onCopyOnWrite(ContentChangeMode) override;
49 void onRestoreBackingMutability() override;
51
52private:
53 SkBitmap fBitmap;
54 bool fWeOwnThePixels;
55
56 using INHERITED = SkSurface_Base;
57};
58
59#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
static void releaseProc(const void *ptr, void *context)
const SkImageInfo & info() const
Definition SkBitmap.h:139
SkSurface_Base::Type type() const override
void onDraw(SkCanvas *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
SkCanvas * onNewCanvas() override
sk_sp< const SkCapabilities > onCapabilities() override
sk_sp< SkSurface > onNewSurface(const SkImageInfo &) override
bool onCopyOnWrite(ContentChangeMode) override
SkImageInfo imageInfo() const override
void onWritePixels(const SkPixmap &, int x, int y) override
void onRestoreBackingMutability() override
sk_sp< SkImage > onNewImageSnapshot(const SkIRect *subset) override
float SkScalar
Definition extension.cpp:12
double y
double x