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

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

Issue 13910009: Use blitframebuffer to implement copySurface. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « gm/mixedxfermodes.cpp ('k') | src/gpu/gl/GrGLIRect.h » ('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 /* 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 10
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 return false; 404 return false;
405 } 405 }
406 return true; 406 return true;
407 } 407 }
408 408
409 bool GrDrawTarget::setupDstReadIfNecessary(DrawInfo* info) { 409 bool GrDrawTarget::setupDstReadIfNecessary(DrawInfo* info) {
410 if (!this->getDrawState().willEffectReadDst()) { 410 if (!this->getDrawState().willEffectReadDst()) {
411 return true; 411 return true;
412 } 412 }
413 GrRenderTarget* rt = this->drawState()->getRenderTarget(); 413 GrRenderTarget* rt = this->drawState()->getRenderTarget();
414 // If the dst is not a texture then we don't currently have a way of copying the
415 // texture. TODO: API-specific impl of onCopySurface that can handle more ca ses.
416 if (NULL == rt->asTexture()) {
417 GrPrintf("Reading Dst of non-texture render target is not currently supp orted.\n");
418 return false;
419 }
420 414
421 const GrClipData* clip = this->getClip(); 415 const GrClipData* clip = this->getClip();
422 GrIRect copyRect; 416 GrIRect copyRect;
423 clip->getConservativeBounds(this->getDrawState().getRenderTarget(), &copyRec t); 417 clip->getConservativeBounds(this->getDrawState().getRenderTarget(), &copyRec t);
424 SkIRect drawIBounds; 418 SkIRect drawIBounds;
425 if (info->getDevIBounds(&drawIBounds)) { 419 if (info->getDevIBounds(&drawIBounds)) {
426 if (!copyRect.intersect(drawIBounds)) { 420 if (!copyRect.intersect(drawIBounds)) {
427 #if GR_DEBUG 421 #if GR_DEBUG
428 GrPrintf("Missed an early reject. Bailing on draw from setupDstReadI fNecessary.\n"); 422 GrPrintf("Missed an early reject. Bailing on draw from setupDstReadI fNecessary.\n");
429 #endif 423 #endif
430 return false; 424 return false;
431 } 425 }
432 } else { 426 } else {
433 #if GR_DEBUG 427 #if GR_DEBUG
434 //GrPrintf("No dev bounds when dst copy is made.\n"); 428 //GrPrintf("No dev bounds when dst copy is made.\n");
435 #endif 429 #endif
436 } 430 }
437 431
438 // The draw will resolve dst if it has MSAA. Two things to consider in the f uture: 432 // MSAA consideration: When there is support for reading MSAA samples in the shader we could
439 // 1) to make the dst values be pre-resolve we'd need to be able to copy to MSAA 433 // have per-sample dst values by making the copy multisampled.
440 // texture and sample it correctly in the shader. 2) If 1 isn't available th en we
441 // should just resolve and use the resolved texture directly rather than mak ing a
442 // copy of it.
443 GrTextureDesc desc; 434 GrTextureDesc desc;
444 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; 435 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
445 desc.fWidth = copyRect.width(); 436 desc.fWidth = copyRect.width();
446 desc.fHeight = copyRect.height(); 437 desc.fHeight = copyRect.height();
447 desc.fSampleCnt = 0; 438 desc.fSampleCnt = 0;
448 desc.fConfig = rt->config(); 439 desc.fConfig = rt->config();
449 440
450 GrAutoScratchTexture ast(fContext, desc, GrContext::kApprox_ScratchTexMatch) ; 441 GrAutoScratchTexture ast(fContext, desc, GrContext::kApprox_ScratchTexMatch) ;
451 442
452 if (NULL == ast.texture()) { 443 if (NULL == ast.texture()) {
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]); 930 GrPrintf("HW AA Lines Support : %s\n", gNY[fHWAALineSupport]);
940 GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport] ); 931 GrPrintf("Shader Derivative Support : %s\n", gNY[fShaderDerivativeSupport] );
941 GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]); 932 GrPrintf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSupport]);
942 GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppor t]); 933 GrPrintf("Dual Source Blending Support: %s\n", gNY[fDualSourceBlendingSuppor t]);
943 GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]); 934 GrPrintf("Buffer Lock Support : %s\n", gNY[fBufferLockSupport]);
944 GrPrintf("Path Stenciling Support : %s\n", gNY[fPathStencilingSupport]); 935 GrPrintf("Path Stenciling Support : %s\n", gNY[fPathStencilingSupport]);
945 GrPrintf("Max Texture Size : %d\n", fMaxTextureSize); 936 GrPrintf("Max Texture Size : %d\n", fMaxTextureSize);
946 GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize); 937 GrPrintf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
947 GrPrintf("Max Sample Count : %d\n", fMaxSampleCount); 938 GrPrintf("Max Sample Count : %d\n", fMaxSampleCount);
948 } 939 }
OLDNEW
« no previous file with comments | « gm/mixedxfermodes.cpp ('k') | src/gpu/gl/GrGLIRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698