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

Unified Diff: src/gpu/GrDrawState.h

Issue 533883004: Remove GrDrawTarget::AutoRenderTargetRestore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pass rt to clearStencilClip Created 6 years, 3 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: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index ec0ccade3746dec09bb10201b03eec04c903b38d..00bec9f7c24f45e9088440bd6cdd1614e1d8764d 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -380,40 +380,6 @@ public:
*/
void setRenderTarget(GrRenderTarget* target) { fRenderTarget.reset(SkSafeRef(target)); }
- class AutoRenderTargetRestore : public ::SkNoncopyable {
- public:
- AutoRenderTargetRestore() : fDrawState(NULL), fSavedTarget(NULL) {}
- AutoRenderTargetRestore(GrDrawState* ds, GrRenderTarget* newTarget) {
- fDrawState = NULL;
- fSavedTarget = NULL;
- this->set(ds, newTarget);
- }
- ~AutoRenderTargetRestore() { this->restore(); }
-
- void restore() {
- if (NULL != fDrawState) {
- fDrawState->setRenderTarget(fSavedTarget);
- fDrawState = NULL;
- }
- SkSafeSetNull(fSavedTarget);
- }
-
- void set(GrDrawState* ds, GrRenderTarget* newTarget) {
- this->restore();
-
- if (NULL != ds) {
- SkASSERT(NULL == fSavedTarget);
- fSavedTarget = ds->getRenderTarget();
- SkSafeRef(fSavedTarget);
- ds->setRenderTarget(newTarget);
- fDrawState = ds;
- }
- }
- private:
- GrDrawState* fDrawState;
- GrRenderTarget* fSavedTarget;
- };
-
/// @}
///////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrGpu.h » ('j') | src/gpu/gl/GrGpuGL.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698