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

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

Issue 1703603002: Workaround for bug in Tegra 3 when uploading to a render target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment Created 4 years, 10 months 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/GrCaps.cpp ('k') | src/gpu/gl/GrGLCaps.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 * 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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698