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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 art.set(this->drawState(), renderTarget); | 212 art.set(this->drawState(), renderTarget); |
213 } | 213 } |
214 if (NULL == this->getDrawState().getRenderTarget()) { | 214 if (NULL == this->getDrawState().getRenderTarget()) { |
215 SkASSERT(0); | 215 SkASSERT(0); |
216 return; | 216 return; |
217 } | 217 } |
218 this->handleDirtyContext(); | 218 this->handleDirtyContext(); |
219 this->onClear(rect, color, canIgnoreRect); | 219 this->onClear(rect, color, canIgnoreRect); |
220 } | 220 } |
221 | 221 |
222 void GrGpu::forceRenderTargetFlush() { | |
223 this->handleDirtyContext(); | |
224 this->onForceRenderTargetFlush(); | |
225 } | |
226 | |
227 bool GrGpu::readPixels(GrRenderTarget* target, | 222 bool GrGpu::readPixels(GrRenderTarget* target, |
228 int left, int top, int width, int height, | 223 int left, int top, int width, int height, |
229 GrPixelConfig config, void* buffer, | 224 GrPixelConfig config, void* buffer, |
230 size_t rowBytes) { | 225 size_t rowBytes) { |
231 this->handleDirtyContext(); | 226 this->handleDirtyContext(); |
232 return this->onReadPixels(target, left, top, width, height, | 227 return this->onReadPixels(target, left, top, width, height, |
233 config, buffer, rowBytes); | 228 config, buffer, rowBytes); |
234 } | 229 } |
235 | 230 |
236 bool GrGpu::writeTexturePixels(GrTexture* texture, | 231 bool GrGpu::writeTexturePixels(GrTexture* texture, |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 550 } |
556 | 551 |
557 void GrGpu::releaseIndexArray() { | 552 void GrGpu::releaseIndexArray() { |
558 // if index source was array, we stowed data in the pool | 553 // if index source was array, we stowed data in the pool |
559 const GeometrySrcState& geoSrc = this->getGeomSrc(); | 554 const GeometrySrcState& geoSrc = this->getGeomSrc(); |
560 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 555 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); |
561 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 556 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |
562 fIndexPool->putBack(bytes); | 557 fIndexPool->putBack(bytes); |
563 --fIndexPoolUseCnt; | 558 --fIndexPoolUseCnt; |
564 } | 559 } |
OLD | NEW |