| 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 #include "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 this->clipMaskManager()->adjustPathStencilParams(sb, outStencilSettings); | 207 this->clipMaskManager()->adjustPathStencilParams(sb, outStencilSettings); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void GrDrawTarget::stencilPath(GrPipelineBuilder* pipelineBuilder, | 210 void GrDrawTarget::stencilPath(GrPipelineBuilder* pipelineBuilder, |
| 211 const GrPathProcessor* pathProc, | 211 const GrPathProcessor* pathProc, |
| 212 const GrPath* path, | 212 const GrPath* path, |
| 213 GrPathRendering::FillType fill) { | 213 GrPathRendering::FillType fill) { |
| 214 // TODO: extract portions of checkDraw that are relevant to path stenciling. | 214 // TODO: extract portions of checkDraw that are relevant to path stenciling. |
| 215 SkASSERT(path); | 215 SkASSERT(path); |
| 216 SkASSERT(this->caps()->pathRenderingSupport()); | 216 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport()); |
| 217 SkASSERT(pipelineBuilder); | 217 SkASSERT(pipelineBuilder); |
| 218 | 218 |
| 219 // Setup clip | 219 // Setup clip |
| 220 GrScissorState scissorState; | 220 GrScissorState scissorState; |
| 221 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; | 221 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; |
| 222 GrPipelineBuilder::AutoRestoreStencil ars; | 222 GrPipelineBuilder::AutoRestoreStencil ars; |
| 223 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, NULL)) { | 223 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, NULL)) { |
| 224 return; | 224 return; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // set stencil settings for path | 227 // set stencil settings for path |
| 228 GrStencilSettings stencilSettings; | 228 GrStencilSettings stencilSettings; |
| 229 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); | 229 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); |
| 230 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); | 230 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); |
| 231 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); | 231 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); |
| 232 | 232 |
| 233 this->onStencilPath(*pipelineBuilder, pathProc, path, scissorState, stencilS
ettings); | 233 this->onStencilPath(*pipelineBuilder, pathProc, path, scissorState, stencilS
ettings); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void GrDrawTarget::drawPath(GrPipelineBuilder* pipelineBuilder, | 236 void GrDrawTarget::drawPath(GrPipelineBuilder* pipelineBuilder, |
| 237 const GrPathProcessor* pathProc, | 237 const GrPathProcessor* pathProc, |
| 238 const GrPath* path, | 238 const GrPath* path, |
| 239 GrPathRendering::FillType fill) { | 239 GrPathRendering::FillType fill) { |
| 240 // TODO: extract portions of checkDraw that are relevant to path rendering. | 240 // TODO: extract portions of checkDraw that are relevant to path rendering. |
| 241 SkASSERT(path); | 241 SkASSERT(path); |
| 242 SkASSERT(this->caps()->pathRenderingSupport()); | 242 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport()); |
| 243 SkASSERT(pipelineBuilder); | 243 SkASSERT(pipelineBuilder); |
| 244 | 244 |
| 245 SkRect devBounds = path->getBounds(); | 245 SkRect devBounds = path->getBounds(); |
| 246 pathProc->viewMatrix().mapRect(&devBounds); | 246 pathProc->viewMatrix().mapRect(&devBounds); |
| 247 | 247 |
| 248 // Setup clip | 248 // Setup clip |
| 249 GrScissorState scissorState; | 249 GrScissorState scissorState; |
| 250 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; | 250 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; |
| 251 GrPipelineBuilder::AutoRestoreStencil ars; | 251 GrPipelineBuilder::AutoRestoreStencil ars; |
| 252 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &devBounds
)) { | 252 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &devBounds
)) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 270 | 270 |
| 271 void GrDrawTarget::drawPaths(GrPipelineBuilder* pipelineBuilder, | 271 void GrDrawTarget::drawPaths(GrPipelineBuilder* pipelineBuilder, |
| 272 const GrPathProcessor* pathProc, | 272 const GrPathProcessor* pathProc, |
| 273 const GrPathRange* pathRange, | 273 const GrPathRange* pathRange, |
| 274 const void* indices, | 274 const void* indices, |
| 275 PathIndexType indexType, | 275 PathIndexType indexType, |
| 276 const float transformValues[], | 276 const float transformValues[], |
| 277 PathTransformType transformType, | 277 PathTransformType transformType, |
| 278 int count, | 278 int count, |
| 279 GrPathRendering::FillType fill) { | 279 GrPathRendering::FillType fill) { |
| 280 SkASSERT(this->caps()->pathRenderingSupport()); | 280 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport()); |
| 281 SkASSERT(pathRange); | 281 SkASSERT(pathRange); |
| 282 SkASSERT(indices); | 282 SkASSERT(indices); |
| 283 SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeIn
Bytes(indexType)); | 283 SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeIn
Bytes(indexType)); |
| 284 SkASSERT(transformValues); | 284 SkASSERT(transformValues); |
| 285 SkASSERT(pipelineBuilder); | 285 SkASSERT(pipelineBuilder); |
| 286 | 286 |
| 287 // Setup clip | 287 // Setup clip |
| 288 GrScissorState scissorState; | 288 GrScissorState scissorState; |
| 289 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; | 289 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; |
| 290 GrPipelineBuilder::AutoRestoreStencil ars; | 290 GrPipelineBuilder::AutoRestoreStencil ars; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 fColorPOI = fPipelineBuilder->colorProcInfo(batch); | 534 fColorPOI = fPipelineBuilder->colorProcInfo(batch); |
| 535 fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); | 535 fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); |
| 536 if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
POI, | 536 if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
POI, |
| 537 &fDstCopy, devBounds)) { | 537 &fDstCopy, devBounds)) { |
| 538 fPipelineBuilder = NULL; | 538 fPipelineBuilder = NULL; |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 | 541 |
| 542 /////////////////////////////////////////////////////////////////////////////// | 542 /////////////////////////////////////////////////////////////////////////////// |
| 543 | 543 |
| 544 void GrShaderCaps::reset() { |
| 545 fShaderDerivativeSupport = false; |
| 546 fGeometryShaderSupport = false; |
| 547 fPathRenderingSupport = false; |
| 548 fDstReadInShaderSupport = false; |
| 549 fDualSourceBlendingSupport = false; |
| 550 |
| 551 fShaderPrecisionVaries = false; |
| 552 } |
| 553 |
| 554 GrShaderCaps& GrShaderCaps::operator=(const GrShaderCaps& other) { |
| 555 fShaderDerivativeSupport = other.fShaderDerivativeSupport; |
| 556 fGeometryShaderSupport = other.fGeometryShaderSupport; |
| 557 fPathRenderingSupport = other.fPathRenderingSupport; |
| 558 fDstReadInShaderSupport = other.fDstReadInShaderSupport; |
| 559 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |
| 560 |
| 561 fShaderPrecisionVaries = other.fShaderPrecisionVaries; |
| 562 for (int s = 0; s < kGrShaderTypeCount; ++s) { |
| 563 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
| 564 fFloatPrecisions[s][p] = other.fFloatPrecisions[s][p]; |
| 565 } |
| 566 } |
| 567 return *this; |
| 568 } |
| 569 |
| 570 static const char* shader_type_to_string(GrShaderType type) { |
| 571 switch (type) { |
| 572 case kVertex_GrShaderType: |
| 573 return "vertex"; |
| 574 case kGeometry_GrShaderType: |
| 575 return "geometry"; |
| 576 case kFragment_GrShaderType: |
| 577 return "fragment"; |
| 578 } |
| 579 return ""; |
| 580 } |
| 581 |
| 582 static const char* precision_to_string(GrSLPrecision p) { |
| 583 switch (p) { |
| 584 case kLow_GrSLPrecision: |
| 585 return "low"; |
| 586 case kMedium_GrSLPrecision: |
| 587 return "medium"; |
| 588 case kHigh_GrSLPrecision: |
| 589 return "high"; |
| 590 } |
| 591 return ""; |
| 592 } |
| 593 |
| 594 SkString GrShaderCaps::dump() const { |
| 595 SkString r; |
| 596 static const char* gNY[] = { "NO", "YES" }; |
| 597 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivative
Support]); |
| 598 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSu
pport]); |
| 599 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSup
port]); |
| 600 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderS
upport]); |
| 601 r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendi
ngSupport]); |
| 602 |
| 603 r.appendf("Shader Float Precisions (varies: %s):\n", gNY[fShaderPrecisionVar
ies]); |
| 604 |
| 605 for (int s = 0; s < kGrShaderTypeCount; ++s) { |
| 606 GrShaderType shaderType = static_cast<GrShaderType>(s); |
| 607 r.appendf("\t%s:\n", shader_type_to_string(shaderType)); |
| 608 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
| 609 if (fFloatPrecisions[s][p].supported()) { |
| 610 GrSLPrecision precision = static_cast<GrSLPrecision>(p); |
| 611 r.appendf("\t\t%s: log_low: %d log_high: %d bits: %d\n", |
| 612 precision_to_string(precision), |
| 613 fFloatPrecisions[s][p].fLogRangeLow, |
| 614 fFloatPrecisions[s][p].fLogRangeHigh, |
| 615 fFloatPrecisions[s][p].fBits); |
| 616 } |
| 617 } |
| 618 } |
| 619 |
| 620 return r; |
| 621 } |
| 622 |
| 623 /////////////////////////////////////////////////////////////////////////////// |
| 624 |
| 544 void GrDrawTargetCaps::reset() { | 625 void GrDrawTargetCaps::reset() { |
| 545 fMipMapSupport = false; | 626 fMipMapSupport = false; |
| 546 fNPOTTextureTileSupport = false; | 627 fNPOTTextureTileSupport = false; |
| 547 fTwoSidedStencilSupport = false; | 628 fTwoSidedStencilSupport = false; |
| 548 fStencilWrapOpsSupport = false; | 629 fStencilWrapOpsSupport = false; |
| 549 fShaderDerivativeSupport = false; | |
| 550 fGeometryShaderSupport = false; | |
| 551 fDualSourceBlendingSupport = false; | |
| 552 fPathRenderingSupport = false; | |
| 553 fDstReadInShaderSupport = false; | |
| 554 fDiscardRenderTargetSupport = false; | 630 fDiscardRenderTargetSupport = false; |
| 555 fReuseScratchTextures = true; | 631 fReuseScratchTextures = true; |
| 556 fGpuTracingSupport = false; | 632 fGpuTracingSupport = false; |
| 557 fCompressedTexSubImageSupport = false; | 633 fCompressedTexSubImageSupport = false; |
| 558 fOversizedStencilSupport = false; | 634 fOversizedStencilSupport = false; |
| 559 fTextureBarrierSupport = false; | 635 fTextureBarrierSupport = false; |
| 560 | 636 |
| 561 fUseDrawInsteadOfClear = false; | 637 fUseDrawInsteadOfClear = false; |
| 562 | 638 |
| 563 fMapBufferFlags = kNone_MapFlags; | 639 fMapBufferFlags = kNone_MapFlags; |
| 564 | 640 |
| 565 fMaxRenderTargetSize = 0; | 641 fMaxRenderTargetSize = 0; |
| 566 fMaxTextureSize = 0; | 642 fMaxTextureSize = 0; |
| 567 fMaxSampleCount = 0; | 643 fMaxSampleCount = 0; |
| 568 | 644 |
| 569 fShaderPrecisionVaries = false; | |
| 570 | |
| 571 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 645 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
| 572 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 646 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 573 } | 647 } |
| 574 | 648 |
| 575 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 649 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
| 576 fMipMapSupport = other.fMipMapSupport; | 650 fMipMapSupport = other.fMipMapSupport; |
| 577 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 651 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
| 578 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 652 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
| 579 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 653 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
| 580 fShaderDerivativeSupport = other.fShaderDerivativeSupport; | |
| 581 fGeometryShaderSupport = other.fGeometryShaderSupport; | |
| 582 fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; | |
| 583 fPathRenderingSupport = other.fPathRenderingSupport; | |
| 584 fDstReadInShaderSupport = other.fDstReadInShaderSupport; | |
| 585 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 654 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
| 586 fReuseScratchTextures = other.fReuseScratchTextures; | 655 fReuseScratchTextures = other.fReuseScratchTextures; |
| 587 fGpuTracingSupport = other.fGpuTracingSupport; | 656 fGpuTracingSupport = other.fGpuTracingSupport; |
| 588 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; | 657 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; |
| 589 fOversizedStencilSupport = other.fOversizedStencilSupport; | 658 fOversizedStencilSupport = other.fOversizedStencilSupport; |
| 590 fTextureBarrierSupport = other.fTextureBarrierSupport; | 659 fTextureBarrierSupport = other.fTextureBarrierSupport; |
| 591 | 660 |
| 592 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; | 661 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; |
| 593 | 662 |
| 594 fMapBufferFlags = other.fMapBufferFlags; | 663 fMapBufferFlags = other.fMapBufferFlags; |
| 595 | 664 |
| 596 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 665 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
| 597 fMaxTextureSize = other.fMaxTextureSize; | 666 fMaxTextureSize = other.fMaxTextureSize; |
| 598 fMaxSampleCount = other.fMaxSampleCount; | 667 fMaxSampleCount = other.fMaxSampleCount; |
| 599 | 668 |
| 600 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 669 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
| 601 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); | 670 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); |
| 602 | 671 |
| 603 fShaderPrecisionVaries = other.fShaderPrecisionVaries; | |
| 604 for (int s = 0; s < kGrShaderTypeCount; ++s) { | |
| 605 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | |
| 606 fFloatPrecisions[s][p] = other.fFloatPrecisions[s][p]; | |
| 607 } | |
| 608 } | |
| 609 return *this; | 672 return *this; |
| 610 } | 673 } |
| 611 | 674 |
| 612 static SkString map_flags_to_string(uint32_t flags) { | 675 static SkString map_flags_to_string(uint32_t flags) { |
| 613 SkString str; | 676 SkString str; |
| 614 if (GrDrawTargetCaps::kNone_MapFlags == flags) { | 677 if (GrDrawTargetCaps::kNone_MapFlags == flags) { |
| 615 str = "none"; | 678 str = "none"; |
| 616 } else { | 679 } else { |
| 617 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); | 680 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); |
| 618 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kCanMap_MapFlag); | 681 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kCanMap_MapFlag); |
| 619 str = "can_map"; | 682 str = "can_map"; |
| 620 | 683 |
| 621 if (GrDrawTargetCaps::kSubset_MapFlag & flags) { | 684 if (GrDrawTargetCaps::kSubset_MapFlag & flags) { |
| 622 str.append(" partial"); | 685 str.append(" partial"); |
| 623 } else { | 686 } else { |
| 624 str.append(" full"); | 687 str.append(" full"); |
| 625 } | 688 } |
| 626 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kSubset_MapFlag); | 689 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kSubset_MapFlag); |
| 627 } | 690 } |
| 628 SkASSERT(0 == flags); // Make sure we handled all the flags. | 691 SkASSERT(0 == flags); // Make sure we handled all the flags. |
| 629 return str; | 692 return str; |
| 630 } | 693 } |
| 631 | 694 |
| 632 static const char* shader_type_to_string(GrShaderType type) { | |
| 633 switch (type) { | |
| 634 case kVertex_GrShaderType: | |
| 635 return "vertex"; | |
| 636 case kGeometry_GrShaderType: | |
| 637 return "geometry"; | |
| 638 case kFragment_GrShaderType: | |
| 639 return "fragment"; | |
| 640 } | |
| 641 return ""; | |
| 642 } | |
| 643 | |
| 644 static const char* precision_to_string(GrSLPrecision p) { | |
| 645 switch (p) { | |
| 646 case kLow_GrSLPrecision: | |
| 647 return "low"; | |
| 648 case kMedium_GrSLPrecision: | |
| 649 return "medium"; | |
| 650 case kHigh_GrSLPrecision: | |
| 651 return "high"; | |
| 652 } | |
| 653 return ""; | |
| 654 } | |
| 655 | |
| 656 SkString GrDrawTargetCaps::dump() const { | 695 SkString GrDrawTargetCaps::dump() const { |
| 657 SkString r; | 696 SkString r; |
| 658 static const char* gNY[] = {"NO", "YES"}; | 697 static const char* gNY[] = {"NO", "YES"}; |
| 659 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); | 698 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); |
| 660 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); | 699 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); |
| 661 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 700 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
| 662 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 701 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
| 663 r.appendf("Shader Derivative Support : %s\n", gNY[fShaderDerivative
Support]); | |
| 664 r.appendf("Geometry Shader Support : %s\n", gNY[fGeometryShaderSu
pport]); | |
| 665 r.appendf("Dual Source Blending Support : %s\n", gNY[fDualSourceBlendi
ngSupport]); | |
| 666 r.appendf("Path Rendering Support : %s\n", gNY[fPathRenderingSup
port]); | |
| 667 r.appendf("Dst Read In Shader Support : %s\n", gNY[fDstReadInShaderS
upport]); | |
| 668 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 702 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
| 669 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 703 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
| 670 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 704 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
| 671 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 705 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
| 672 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 706 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
| 673 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 707 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
| 674 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); | 708 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); |
| 675 | 709 |
| 676 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 710 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
| 677 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; | 711 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 } | 757 } |
| 724 | 758 |
| 725 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 759 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
| 726 | 760 |
| 727 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 761 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
| 728 r.appendf("%s is uploadable to a texture: %s\n", | 762 r.appendf("%s is uploadable to a texture: %s\n", |
| 729 kConfigNames[i], | 763 kConfigNames[i], |
| 730 gNY[fConfigTextureSupport[i]]); | 764 gNY[fConfigTextureSupport[i]]); |
| 731 } | 765 } |
| 732 | 766 |
| 733 r.appendf("Shader Float Precisions (varies: %s):\n", gNY[fShaderPrecisionVar
ies]); | |
| 734 | |
| 735 for (int s = 0; s < kGrShaderTypeCount; ++s) { | |
| 736 GrShaderType shaderType = static_cast<GrShaderType>(s); | |
| 737 r.appendf("\t%s:\n", shader_type_to_string(shaderType)); | |
| 738 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | |
| 739 if (fFloatPrecisions[s][p].supported()) { | |
| 740 GrSLPrecision precision = static_cast<GrSLPrecision>(p); | |
| 741 r.appendf("\t\t%s: log_low: %d log_high: %d bits: %d\n", | |
| 742 precision_to_string(precision), | |
| 743 fFloatPrecisions[s][p].fLogRangeLow, | |
| 744 fFloatPrecisions[s][p].fLogRangeHigh, | |
| 745 fFloatPrecisions[s][p].fBits); | |
| 746 } | |
| 747 } | |
| 748 } | |
| 749 | |
| 750 return r; | 767 return r; |
| 751 } | 768 } |
| 752 | 769 |
| 753 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 770 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 754 | 771 |
| 755 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, | 772 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, |
| 756 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 773 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
| 757 GrPipelineBuilder::AutoRestoreStencil* ars, | 774 GrPipelineBuilder::AutoRestoreStencil* ars, |
| 758 GrScissorState* scissorState, | 775 GrScissorState* scissorState, |
| 759 const SkRect* devBounds) { | 776 const SkRect* devBounds) { |
| 760 return fClipMaskManager.setupClipping(pipelineBuilder, | 777 return fClipMaskManager.setupClipping(pipelineBuilder, |
| 761 arfp, | 778 arfp, |
| 762 ars, | 779 ars, |
| 763 scissorState, | 780 scissorState, |
| 764 devBounds); | 781 devBounds); |
| 765 } | 782 } |
| OLD | NEW |