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

Unified Diff: src/gpu/SkGpuDevice.h

Issue 912243004: Make all SkSurface_* -related devices all have a device (Closed) Base URL: https://skia.googlesource.com/skia.git@skimage-filters-03-sksurface-set-root-device
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 5fbc9f1b487a09dfdaaee26d15f30ccc28b20815..8a0866051993c85a655e2682b42345020e630b8d 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
@@ -48,8 +49,12 @@ public:
static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&,
int sampleCount, const SkSurfaceProps*, unsigned flags = 0);
+ static SkGpuDevice* CreateWithReverseOwnershipDeprecated(GrRenderTarget* target, const SkSurfaceProps*, unsigned flags = 0);
+
virtual ~SkGpuDevice();
+ void setSurface(SkSurface_Gpu* surface);
+
SkGpuDevice* cloneDevice(const SkSurfaceProps& props) {
SkBaseDevice* dev = this->onCreateCompatibleDevice(CreateInfo(this->imageInfo(),
kGeneral_Usage,
@@ -64,7 +69,6 @@ public:
void swapRenderTarget(GrRenderTarget* newTarget);
-
GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
SkImageInfo imageInfo() const SK_OVERRIDE {
@@ -73,6 +77,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;
@@ -146,7 +152,8 @@ private:
// remove when our clients don't rely on accessBitmap()
SkBitmap fLegacyBitmap;
bool fNeedClear;
-
+ SkSurface_Gpu* fSurface;
+ bool fDeviceOwnsSurface;
SkGpuDevice(GrRenderTarget*, const SkSurfaceProps*, unsigned flags);
SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE;
« 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