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

Unified Diff: src/gpu/SkGpuDevice.h

Issue 1569833004: Fix unref order in SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 11 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 | « no previous file | 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 a35e92bc250ec01a93d7ddeb5458e4db9c781c61..19bef2103811e5d70daf70415cf6222c07c54efe 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -15,6 +15,7 @@
#include "SkPicture.h"
#include "SkRegion.h"
#include "SkSurface.h"
+#include "GrDrawContext.h"
#include "GrContext.h"
#include "GrSurfacePriv.h"
@@ -53,7 +54,7 @@ public:
static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&,
int sampleCount, const SkSurfaceProps*, InitContents);
- virtual ~SkGpuDevice();
+ ~SkGpuDevice() override {}
SkGpuDevice* cloneDevice(const SkSurfaceProps& props) {
SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), kPossible_TileUsage,
@@ -153,12 +154,14 @@ protected:
const SkMatrix*, const SkPaint*) override;
private:
- GrContext* fContext;
+ // We want these unreffed in DrawContext, RenderTarget, GrContext order.
+ SkAutoTUnref<GrContext> fContext;
+ SkAutoTUnref<GrRenderTarget> fRenderTarget;
+ SkAutoTUnref<GrDrawContext> fDrawContext;
+
SkAutoTUnref<const SkClipStack> fClipStack;
SkIPoint fClipOrigin;
- GrClip fClip;
- SkAutoTUnref<GrDrawContext> fDrawContext;
- GrRenderTarget* fRenderTarget;
+ GrClip fClip;;
// remove when our clients don't rely on accessBitmap()
SkBitmap fLegacyBitmap;
bool fNeedClear;
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698