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

Unified Diff: include/gpu/GrDrawContext.h

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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
Index: include/gpu/GrDrawContext.h
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 61b39079b0cbd71a0499e577aabba76942516e31..7bb9aafc78127252680ee0c88ead0ac79617ae5a 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -278,14 +278,18 @@ public:
int numColorSamples() const { return fRenderTarget->numColorSamples(); }
bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); }
- GrRenderTarget* accessRenderTarget() { return fRenderTarget; }
+ GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); }
+
+ sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; }
+
+ sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); }
// Provides access to functions that aren't part of the public API.
GrDrawContextPriv drawContextPriv();
const GrDrawContextPriv drawContextPriv() const;
protected:
- GrDrawContext(GrContext*, GrDrawingManager*, GrRenderTarget*,
+ GrDrawContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>,
const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*);
GrDrawingManager* drawingManager() { return fDrawingManager; }
@@ -323,7 +327,7 @@ private:
GrDrawTarget* getDrawTarget();
GrDrawingManager* fDrawingManager;
- GrRenderTarget* fRenderTarget;
+ sk_sp<GrRenderTarget> fRenderTarget;
// In MDB-mode the drawTarget can be closed by some other drawContext that has picked
// it up. For this reason, the drawTarget should only ever be accessed via 'getDrawTarget'.
« gm/beziereffects.cpp ('K') | « include/gpu/GrContext.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698