OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |