| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 fFloatPrecisions[s][p].fBits); | 606 fFloatPrecisions[s][p].fBits); |
| 607 } | 607 } |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 | 610 |
| 611 return r; | 611 return r; |
| 612 } | 612 } |
| 613 | 613 |
| 614 /////////////////////////////////////////////////////////////////////////////// | 614 /////////////////////////////////////////////////////////////////////////////// |
| 615 | 615 |
| 616 void GrDrawTargetCaps::reset() { | 616 void GrCaps::reset() { |
| 617 fMipMapSupport = false; | 617 fMipMapSupport = false; |
| 618 fNPOTTextureTileSupport = false; | 618 fNPOTTextureTileSupport = false; |
| 619 fTwoSidedStencilSupport = false; | 619 fTwoSidedStencilSupport = false; |
| 620 fStencilWrapOpsSupport = false; | 620 fStencilWrapOpsSupport = false; |
| 621 fDiscardRenderTargetSupport = false; | 621 fDiscardRenderTargetSupport = false; |
| 622 fReuseScratchTextures = true; | 622 fReuseScratchTextures = true; |
| 623 fGpuTracingSupport = false; | 623 fGpuTracingSupport = false; |
| 624 fCompressedTexSubImageSupport = false; | 624 fCompressedTexSubImageSupport = false; |
| 625 fOversizedStencilSupport = false; | 625 fOversizedStencilSupport = false; |
| 626 fTextureBarrierSupport = false; | 626 fTextureBarrierSupport = false; |
| 627 | 627 |
| 628 fUseDrawInsteadOfClear = false; | 628 fUseDrawInsteadOfClear = false; |
| 629 | 629 |
| 630 fBlendEquationSupport = kBasic_BlendEquationSupport; | 630 fBlendEquationSupport = kBasic_BlendEquationSupport; |
| 631 fMapBufferFlags = kNone_MapFlags; | 631 fMapBufferFlags = kNone_MapFlags; |
| 632 | 632 |
| 633 fMaxRenderTargetSize = 0; | 633 fMaxRenderTargetSize = 0; |
| 634 fMaxTextureSize = 0; | 634 fMaxTextureSize = 0; |
| 635 fMaxSampleCount = 0; | 635 fMaxSampleCount = 0; |
| 636 | 636 |
| 637 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 637 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
| 638 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 638 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 639 } | 639 } |
| 640 | 640 |
| 641 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 641 GrCaps& GrCaps::operator=(const GrCaps& other) { |
| 642 fMipMapSupport = other.fMipMapSupport; | 642 fMipMapSupport = other.fMipMapSupport; |
| 643 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 643 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
| 644 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 644 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
| 645 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 645 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
| 646 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 646 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
| 647 fReuseScratchTextures = other.fReuseScratchTextures; | 647 fReuseScratchTextures = other.fReuseScratchTextures; |
| 648 fGpuTracingSupport = other.fGpuTracingSupport; | 648 fGpuTracingSupport = other.fGpuTracingSupport; |
| 649 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; | 649 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; |
| 650 fOversizedStencilSupport = other.fOversizedStencilSupport; | 650 fOversizedStencilSupport = other.fOversizedStencilSupport; |
| 651 fTextureBarrierSupport = other.fTextureBarrierSupport; | 651 fTextureBarrierSupport = other.fTextureBarrierSupport; |
| 652 | 652 |
| 653 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; | 653 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; |
| 654 | 654 |
| 655 fBlendEquationSupport = other.fBlendEquationSupport; | 655 fBlendEquationSupport = other.fBlendEquationSupport; |
| 656 fMapBufferFlags = other.fMapBufferFlags; | 656 fMapBufferFlags = other.fMapBufferFlags; |
| 657 | 657 |
| 658 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 658 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
| 659 fMaxTextureSize = other.fMaxTextureSize; | 659 fMaxTextureSize = other.fMaxTextureSize; |
| 660 fMaxSampleCount = other.fMaxSampleCount; | 660 fMaxSampleCount = other.fMaxSampleCount; |
| 661 | 661 |
| 662 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 662 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
| 663 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); | 663 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); |
| 664 | 664 |
| 665 return *this; | 665 return *this; |
| 666 } | 666 } |
| 667 | 667 |
| 668 static SkString map_flags_to_string(uint32_t flags) { | 668 static SkString map_flags_to_string(uint32_t flags) { |
| 669 SkString str; | 669 SkString str; |
| 670 if (GrDrawTargetCaps::kNone_MapFlags == flags) { | 670 if (GrCaps::kNone_MapFlags == flags) { |
| 671 str = "none"; | 671 str = "none"; |
| 672 } else { | 672 } else { |
| 673 SkASSERT(GrDrawTargetCaps::kCanMap_MapFlag & flags); | 673 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
| 674 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kCanMap_MapFlag); | 674 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
| 675 str = "can_map"; | 675 str = "can_map"; |
| 676 | 676 |
| 677 if (GrDrawTargetCaps::kSubset_MapFlag & flags) { | 677 if (GrCaps::kSubset_MapFlag & flags) { |
| 678 str.append(" partial"); | 678 str.append(" partial"); |
| 679 } else { | 679 } else { |
| 680 str.append(" full"); | 680 str.append(" full"); |
| 681 } | 681 } |
| 682 SkDEBUGCODE(flags &= ~GrDrawTargetCaps::kSubset_MapFlag); | 682 SkDEBUGCODE(flags &= ~GrCaps::kSubset_MapFlag); |
| 683 } | 683 } |
| 684 SkASSERT(0 == flags); // Make sure we handled all the flags. | 684 SkASSERT(0 == flags); // Make sure we handled all the flags. |
| 685 return str; | 685 return str; |
| 686 } | 686 } |
| 687 | 687 |
| 688 SkString GrDrawTargetCaps::dump() const { | 688 SkString GrCaps::dump() const { |
| 689 SkString r; | 689 SkString r; |
| 690 static const char* gNY[] = {"NO", "YES"}; | 690 static const char* gNY[] = {"NO", "YES"}; |
| 691 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); | 691 r.appendf("MIP Map Support : %s\n", gNY[fMipMapSupport]); |
| 692 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); | 692 r.appendf("NPOT Texture Tile Support : %s\n", gNY[fNPOTTextureTileS
upport]); |
| 693 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); | 693 r.appendf("Two Sided Stencil Support : %s\n", gNY[fTwoSidedStencilS
upport]); |
| 694 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); | 694 r.appendf("Stencil Wrap Ops Support : %s\n", gNY[fStencilWrapOpsSu
pport]); |
| 695 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); | 695 r.appendf("Discard Render Target Support : %s\n", gNY[fDiscardRenderTar
getSupport]); |
| 696 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); | 696 r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchText
ures]); |
| 697 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 697 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
| 698 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 698 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 778 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
| 779 GrPipelineBuilder::AutoRestoreStencil* ars, | 779 GrPipelineBuilder::AutoRestoreStencil* ars, |
| 780 GrScissorState* scissorState, | 780 GrScissorState* scissorState, |
| 781 const SkRect* devBounds) { | 781 const SkRect* devBounds) { |
| 782 return fClipMaskManager.setupClipping(pipelineBuilder, | 782 return fClipMaskManager.setupClipping(pipelineBuilder, |
| 783 arfp, | 783 arfp, |
| 784 ars, | 784 ars, |
| 785 scissorState, | 785 scissorState, |
| 786 devBounds); | 786 devBounds); |
| 787 } | 787 } |
| OLD | NEW |