Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: src/gpu/SkGpuDevice.h

Issue 926843003: Move canvas->surface association to the device subclasses (Closed) Base URL: https://skia.googlesource.com/skia.git@skimage-filters-03-sksurface-set-root-device-simple
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.h
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 9eddc41a21521153902ac8b27037b4fc56f2c37d..b2419601fa908c22cf00498498a6f68b3222c57b 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -24,6 +24,7 @@ struct GrSkDrawProcs;
class GrAccelData;
struct GrCachedLayer;
class GrTextContext;
+class SkSurface_Gpu;
/**
* Subclass of SkBaseDevice, which directs all drawing to the GrGpu owned by the
@@ -50,6 +51,10 @@ public:
virtual ~SkGpuDevice();
+ void setSurface(SkSurface_Gpu* surface) {
+ fSurface = surface;
+ }
+
/** Creates a render targetthat can be used as the render target of the device. */
static GrRenderTarget* CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted,
const SkImageInfo& info, int sampleCount);
@@ -66,7 +71,7 @@ public:
// set all pixels to 0
void clearAll();
- void swapRenderTarget(GrRenderTarget* newTarget);
+ void detachBackendRenderTarget(bool retainContent);
GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
@@ -76,6 +81,8 @@ public:
const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
+ void discard() SK_OVERRIDE;
+
void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count,
const SkPoint[], const SkPaint& paint) SK_OVERRIDE;
@@ -149,6 +156,7 @@ private:
// remove when our clients don't rely on accessBitmap()
SkBitmap fLegacyBitmap;
bool fNeedClear;
+ SkSurface_Gpu* fSurface;
SkGpuDevice(GrRenderTarget*, const SkSurfaceProps*, unsigned flags);
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698