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

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

Issue 14864020: Don't call purgeCache() from within GrResource memebers. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrResourceCache.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (fResolveRect.isEmpty()) { 88 if (fResolveRect.isEmpty()) {
89 fResolveRect.setLargestInverted(); 89 fResolveRect.setLargestInverted();
90 } else { 90 } else {
91 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) { 91 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) {
92 fResolveRect.setLargestInverted(); 92 fResolveRect.setLargestInverted();
93 } 93 }
94 } 94 }
95 } 95 }
96 96
97 void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) { 97 void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) {
98 if (stencilBuffer == fStencilBuffer) { 98 SkRefCnt_SafeAssign(fStencilBuffer, stencilBuffer);
99 return;
100 }
101
102 if (NULL != fStencilBuffer) {
103 fStencilBuffer->unref();
104
105 GrContext* context = this->getContext();
106 if (NULL != context) {
107 context->purgeCache();
108 }
109
110 if (NULL != context) {
111 context->purgeCache();
112 }
113 }
114
115 fStencilBuffer = stencilBuffer;
116
117 if (NULL != fStencilBuffer) {
118 fStencilBuffer->ref();
119 }
120 } 99 }
121 100
122 void GrRenderTarget::onRelease() { 101 void GrRenderTarget::onRelease() {
123 this->setStencilBuffer(NULL); 102 this->setStencilBuffer(NULL);
124 103
125 INHERITED::onRelease(); 104 INHERITED::onRelease();
126 } 105 }
127 106
128 void GrRenderTarget::onAbandon() { 107 void GrRenderTarget::onAbandon() {
129 this->setStencilBuffer(NULL); 108 this->setStencilBuffer(NULL);
130 109
131 INHERITED::onAbandon(); 110 INHERITED::onAbandon();
132 } 111 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698