OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 | 10 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 WritePixelTempDrawInfo* tempDrawInfo) { | 273 WritePixelTempDrawInfo* tempDrawInfo) { |
274 SkASSERT(drawPreference); | 274 SkASSERT(drawPreference); |
275 SkASSERT(tempDrawInfo); | 275 SkASSERT(tempDrawInfo); |
276 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference); | 276 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference); |
277 | 277 |
278 if (GrPixelConfigIsCompressed(dstSurface->desc().fConfig) && | 278 if (GrPixelConfigIsCompressed(dstSurface->desc().fConfig) && |
279 dstSurface->desc().fConfig != srcConfig) { | 279 dstSurface->desc().fConfig != srcConfig) { |
280 return false; | 280 return false; |
281 } | 281 } |
282 | 282 |
283 if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() && | 283 if (SkToBool(dstSurface->asRenderTarget())) { |
284 SkToBool(dstSurface->asRenderTarget()) && | 284 if (this->caps()->useDrawInsteadOfAllRenderTargetWrites()) { |
285 (width < dstSurface->width() || height < dstSurface->height())) { | 285 ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); |
286 ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); | 286 } else if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() && |
| 287 (width < dstSurface->width() || height < dstSurface->height()
)) { |
| 288 ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); |
| 289 } |
287 } | 290 } |
288 | 291 |
289 if (!this->onGetWritePixelsInfo(dstSurface, width, height, rowBytes, srcConf
ig, drawPreference, | 292 if (!this->onGetWritePixelsInfo(dstSurface, width, height, rowBytes, srcConf
ig, drawPreference, |
290 tempDrawInfo)) { | 293 tempDrawInfo)) { |
291 return false; | 294 return false; |
292 } | 295 } |
293 | 296 |
294 // Check to see if we're going to request that the caller draw when drawing
is not possible. | 297 // Check to see if we're going to request that the caller draw when drawing
is not possible. |
295 if (!dstSurface->asRenderTarget() || | 298 if (!dstSurface->asRenderTarget() || |
296 !this->caps()->isConfigTexturable(tempDrawInfo->fTempSurfaceDesc.fConfig
)) { | 299 !this->caps()->isConfigTexturable(tempDrawInfo->fTempSurfaceDesc.fConfig
)) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 381 } |
379 | 382 |
380 GrVertices::Iterator iter; | 383 GrVertices::Iterator iter; |
381 const GrNonInstancedVertices* verts = iter.init(vertices); | 384 const GrNonInstancedVertices* verts = iter.init(vertices); |
382 do { | 385 do { |
383 this->onDraw(args, *verts); | 386 this->onDraw(args, *verts); |
384 fStats.incNumDraws(); | 387 fStats.incNumDraws(); |
385 } while ((verts = iter.next())); | 388 } while ((verts = iter.next())); |
386 } | 389 } |
387 | 390 |
OLD | NEW |