From 06dd0a8222cc97236a2d20d563e27995983e6e0c Mon Sep 17 00:00:00 2001 From: joshualitt Date: Fri, 8 Jan 2016 06:32:31 -0800 Subject: Fix unref order in SkGpuDevice GrContext should be unrefed after GrDrawContext. TBR=bsalomon@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1569833004 Review URL: https://codereview.chromium.org/1569833004 --- src/gpu/SkGpuDevice.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gpu/SkGpuDevice.h') diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index a35e92bc25..19bef21038 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 fContext; + SkAutoTUnref fRenderTarget; + SkAutoTUnref fDrawContext; + SkAutoTUnref fClipStack; SkIPoint fClipOrigin; - GrClip fClip; - SkAutoTUnref fDrawContext; - GrRenderTarget* fRenderTarget; + GrClip fClip;; // remove when our clients don't rely on accessBitmap() SkBitmap fLegacyBitmap; bool fNeedClear; -- cgit v1.2.3