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

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

Issue 680413005: Don't allow renderTarget==NULL to GrContext::clear() and friends. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('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 2010 Google Inc. 3 * Copyright 2010 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 "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 buffer->unmap(); 191 buffer->unmap();
192 } 192 }
193 } 193 }
194 return buffer; 194 return buffer;
195 } 195 }
196 196
197 void GrGpu::clear(const SkIRect* rect, 197 void GrGpu::clear(const SkIRect* rect,
198 GrColor color, 198 GrColor color,
199 bool canIgnoreRect, 199 bool canIgnoreRect,
200 GrRenderTarget* renderTarget) { 200 GrRenderTarget* renderTarget) {
201 if (NULL == renderTarget) { 201 SkASSERT(renderTarget);
202 renderTarget = this->getDrawState().getRenderTarget();
203 }
204 if (NULL == renderTarget) {
205 SkASSERT(0);
206 return;
207 }
208 this->handleDirtyContext(); 202 this->handleDirtyContext();
209 this->onClear(renderTarget, rect, color, canIgnoreRect); 203 this->onClear(renderTarget, rect, color, canIgnoreRect);
210 } 204 }
211 205
212 void GrGpu::clearStencilClip(const SkIRect& rect, 206 void GrGpu::clearStencilClip(const SkIRect& rect,
213 bool insideClip, 207 bool insideClip,
214 GrRenderTarget* renderTarget) { 208 GrRenderTarget* renderTarget) {
215 if (NULL == renderTarget) { 209 if (NULL == renderTarget) {
216 renderTarget = this->getDrawState().getRenderTarget(); 210 renderTarget = this->getDrawState().getRenderTarget();
217 } 211 }
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 554 }
561 555
562 void GrGpu::releaseIndexArray() { 556 void GrGpu::releaseIndexArray() {
563 // if index source was array, we stowed data in the pool 557 // if index source was array, we stowed data in the pool
564 const GeometrySrcState& geoSrc = this->getGeomSrc(); 558 const GeometrySrcState& geoSrc = this->getGeomSrc();
565 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 559 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
566 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 560 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
567 fIndexPool->putBack(bytes); 561 fIndexPool->putBack(bytes);
568 --fIndexPoolUseCnt; 562 --fIndexPoolUseCnt;
569 } 563 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698