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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { | 200 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { |
201 SkASSERT(this->caps()->pathRenderingSupport()); | 201 SkASSERT(this->caps()->pathRenderingSupport()); |
202 this->handleDirtyContext(); | 202 this->handleDirtyContext(); |
203 return this->onCreatePath(path, stroke); | 203 return this->onCreatePath(path, stroke); |
204 } | 204 } |
205 | 205 |
206 void GrGpu::clear(const SkIRect* rect, | 206 void GrGpu::clear(const SkIRect* rect, |
207 GrColor color, | 207 GrColor color, |
| 208 bool canIgnoreRect, |
208 GrRenderTarget* renderTarget) { | 209 GrRenderTarget* renderTarget) { |
209 GrDrawState::AutoRenderTargetRestore art; | 210 GrDrawState::AutoRenderTargetRestore art; |
210 if (NULL != renderTarget) { | 211 if (NULL != renderTarget) { |
211 art.set(this->drawState(), renderTarget); | 212 art.set(this->drawState(), renderTarget); |
212 } | 213 } |
213 if (NULL == this->getDrawState().getRenderTarget()) { | 214 if (NULL == this->getDrawState().getRenderTarget()) { |
214 SkASSERT(0); | 215 SkASSERT(0); |
215 return; | 216 return; |
216 } | 217 } |
217 this->handleDirtyContext(); | 218 this->handleDirtyContext(); |
218 this->onClear(rect, color); | 219 this->onClear(rect, color, canIgnoreRect); |
219 } | 220 } |
220 | 221 |
221 void GrGpu::forceRenderTargetFlush() { | 222 void GrGpu::forceRenderTargetFlush() { |
222 this->handleDirtyContext(); | 223 this->handleDirtyContext(); |
223 this->onForceRenderTargetFlush(); | 224 this->onForceRenderTargetFlush(); |
224 } | 225 } |
225 | 226 |
226 bool GrGpu::readPixels(GrRenderTarget* target, | 227 bool GrGpu::readPixels(GrRenderTarget* target, |
227 int left, int top, int width, int height, | 228 int left, int top, int width, int height, |
228 GrPixelConfig config, void* buffer, | 229 GrPixelConfig config, void* buffer, |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 539 } |
539 | 540 |
540 void GrGpu::releaseIndexArray() { | 541 void GrGpu::releaseIndexArray() { |
541 // if index source was array, we stowed data in the pool | 542 // if index source was array, we stowed data in the pool |
542 const GeometrySrcState& geoSrc = this->getGeomSrc(); | 543 const GeometrySrcState& geoSrc = this->getGeomSrc(); |
543 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 544 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); |
544 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 545 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |
545 fIndexPool->putBack(bytes); | 546 fIndexPool->putBack(bytes); |
546 --fIndexPoolUseCnt; | 547 --fIndexPoolUseCnt; |
547 } | 548 } |
OLD | NEW |