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

Side by Side Diff: src/gpu/GrDrawingManager.cpp

Issue 1416113006: Minor cleanup of clip mask manager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrPathRendererChain.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrAtlasTextContext.h" 8 #include "GrAtlasTextContext.h"
9 #include "GrDrawContext.h" 9 #include "GrDrawContext.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 13 matching lines...) Expand all
24 delete fNVPRTextContext; 24 delete fNVPRTextContext;
25 fNVPRTextContext = nullptr; 25 fNVPRTextContext = nullptr;
26 26
27 for (int i = 0; i < kNumPixelGeometries; ++i) { 27 for (int i = 0; i < kNumPixelGeometries; ++i) {
28 delete fTextContexts[i][0]; 28 delete fTextContexts[i][0];
29 fTextContexts[i][0] = nullptr; 29 fTextContexts[i][0] = nullptr;
30 delete fTextContexts[i][1]; 30 delete fTextContexts[i][1];
31 fTextContexts[i][1] = nullptr; 31 fTextContexts[i][1] = nullptr;
32 } 32 }
33 33
34 SkSafeSetNull(fPathRendererChain); 34 delete fPathRendererChain;
35 fPathRendererChain = nullptr;
35 SkSafeSetNull(fSoftwarePathRenderer); 36 SkSafeSetNull(fSoftwarePathRenderer);
36 } 37 }
37 38
38 GrDrawingManager::~GrDrawingManager() { 39 GrDrawingManager::~GrDrawingManager() {
39 this->cleanup(); 40 this->cleanup();
40 } 41 }
41 42
42 void GrDrawingManager::abandon() { 43 void GrDrawingManager::abandon() {
43 fAbandoned = true; 44 fAbandoned = true;
44 this->cleanup(); 45 this->cleanup();
45 } 46 }
46 47
47 void GrDrawingManager::freeGpuResources() { 48 void GrDrawingManager::freeGpuResources() {
48 // a path renderer may be holding onto resources 49 // a path renderer may be holding onto resources
49 SkSafeSetNull(fPathRendererChain); 50 delete fPathRendererChain;
51 fPathRendererChain = nullptr;
50 SkSafeSetNull(fSoftwarePathRenderer); 52 SkSafeSetNull(fSoftwarePathRenderer);
51 } 53 }
52 54
53 void GrDrawingManager::reset() { 55 void GrDrawingManager::reset() {
54 for (int i = 0; i < fDrawTargets.count(); ++i) { 56 for (int i = 0; i < fDrawTargets.count(); ++i) {
55 fDrawTargets[i]->reset(); 57 fDrawTargets[i]->reset();
56 } 58 }
57 } 59 }
58 60
59 void GrDrawingManager::flush() { 61 void GrDrawingManager::flush() {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 153 }
152 154
153 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt, 155 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
154 const SkSurfaceProps* surfaceProps) { 156 const SkSurfaceProps* surfaceProps) {
155 if (this->abandoned()) { 157 if (this->abandoned()) {
156 return nullptr; 158 return nullptr;
157 } 159 }
158 160
159 return new GrDrawContext(this, rt, surfaceProps); 161 return new GrDrawContext(this, rt, surfaceProps);
160 } 162 }
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrPathRendererChain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698