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

Unified Diff: src/gpu/GrContext.cpp

Issue 702083003: Add mock context and use in ResourceCacheTest. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: restore removed null check Created 6 years, 1 month 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 | « include/gpu/GrContext.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5891840ac61bdad12de328ab56f02102564589bf..a456a799c89af7f1388a68e5919151eebd093d05 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -121,7 +121,11 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
if (NULL == fGpu) {
return false;
}
+ this->initCommon();
+ return true;
+}
+void GrContext::initCommon() {
fDrawState = SkNEW(GrDrawState);
fGpu->setDrawState(fDrawState);
@@ -141,8 +145,6 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
fDidTestPMConversions = false;
this->setupDrawBuffer();
-
- return true;
}
GrContext::~GrContext() {
@@ -156,14 +158,14 @@ GrContext::~GrContext() {
(*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
}
- delete fResourceCache2;
+ SkDELETE(fResourceCache2);
fResourceCache2 = NULL;
- delete fResourceCache;
+ SkDELETE(fResourceCache);
fResourceCache = NULL;
- delete fFontCache;
- delete fDrawBuffer;
- delete fDrawBufferVBAllocPool;
- delete fDrawBufferIBAllocPool;
+ SkDELETE(fFontCache);
+ SkDELETE(fDrawBuffer);
+ SkDELETE(fDrawBufferVBAllocPool);
+ SkDELETE(fDrawBufferIBAllocPool);
fAARectRenderer->unref();
fOvalRenderer->unref();
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698