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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 fStencilWrapOpsSupport = false; | 641 fStencilWrapOpsSupport = false; |
642 fDiscardRenderTargetSupport = false; | 642 fDiscardRenderTargetSupport = false; |
643 fReuseScratchTextures = true; | 643 fReuseScratchTextures = true; |
644 fGpuTracingSupport = false; | 644 fGpuTracingSupport = false; |
645 fCompressedTexSubImageSupport = false; | 645 fCompressedTexSubImageSupport = false; |
646 fOversizedStencilSupport = false; | 646 fOversizedStencilSupport = false; |
647 fTextureBarrierSupport = false; | 647 fTextureBarrierSupport = false; |
648 | 648 |
649 fUseDrawInsteadOfClear = false; | 649 fUseDrawInsteadOfClear = false; |
650 | 650 |
| 651 fBlendEquationSupport = kBasic_BlendEquationSupport; |
651 fMapBufferFlags = kNone_MapFlags; | 652 fMapBufferFlags = kNone_MapFlags; |
652 | 653 |
653 fMaxRenderTargetSize = 0; | 654 fMaxRenderTargetSize = 0; |
654 fMaxTextureSize = 0; | 655 fMaxTextureSize = 0; |
655 fMaxSampleCount = 0; | 656 fMaxSampleCount = 0; |
656 | 657 |
657 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 658 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
658 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 659 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
659 } | 660 } |
660 | 661 |
661 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { | 662 GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) { |
662 fMipMapSupport = other.fMipMapSupport; | 663 fMipMapSupport = other.fMipMapSupport; |
663 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; | 664 fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |
664 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; | 665 fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |
665 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; | 666 fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |
666 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; | 667 fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |
667 fReuseScratchTextures = other.fReuseScratchTextures; | 668 fReuseScratchTextures = other.fReuseScratchTextures; |
668 fGpuTracingSupport = other.fGpuTracingSupport; | 669 fGpuTracingSupport = other.fGpuTracingSupport; |
669 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; | 670 fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; |
670 fOversizedStencilSupport = other.fOversizedStencilSupport; | 671 fOversizedStencilSupport = other.fOversizedStencilSupport; |
671 fTextureBarrierSupport = other.fTextureBarrierSupport; | 672 fTextureBarrierSupport = other.fTextureBarrierSupport; |
672 | 673 |
673 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; | 674 fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; |
674 | 675 |
| 676 fBlendEquationSupport = other.fBlendEquationSupport; |
675 fMapBufferFlags = other.fMapBufferFlags; | 677 fMapBufferFlags = other.fMapBufferFlags; |
676 | 678 |
677 fMaxRenderTargetSize = other.fMaxRenderTargetSize; | 679 fMaxRenderTargetSize = other.fMaxRenderTargetSize; |
678 fMaxTextureSize = other.fMaxTextureSize; | 680 fMaxTextureSize = other.fMaxTextureSize; |
679 fMaxSampleCount = other.fMaxSampleCount; | 681 fMaxSampleCount = other.fMaxSampleCount; |
680 | 682 |
681 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); | 683 memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
rSupport)); |
682 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); | 684 memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
tureSupport)); |
683 | 685 |
684 return *this; | 686 return *this; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); | 718 r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSuppor
t]); |
717 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); | 719 r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSub
ImageSupport]); |
718 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); | 720 r.appendf("Oversized Stencil Support : %s\n", gNY[fOversizedStencil
Support]); |
719 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); | 721 r.appendf("Texture Barrier Support : %s\n", gNY[fTextureBarrierSu
pport]); |
720 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); | 722 r.appendf("Draw Instead of Clear [workaround] : %s\n", gNY[fUseDrawInsteadOf
Clear]); |
721 | 723 |
722 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); | 724 r.appendf("Max Texture Size : %d\n", fMaxTextureSize); |
723 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; | 725 r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize)
; |
724 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); | 726 r.appendf("Max Sample Count : %d\n", fMaxSampleCount); |
725 | 727 |
| 728 static const char* kBlendEquationSupportNames[] = { |
| 729 "Basic", |
| 730 "Advanced", |
| 731 "Advanced Coherent", |
| 732 }; |
| 733 GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport); |
| 734 GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport); |
| 735 GR_STATIC_ASSERT(2 == kAdvancedCoherent_BlendEquationSupport); |
| 736 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kBlendEquationSupportNames) == kLastBlendEqu
ationSupport + 1); |
| 737 |
| 738 r.appendf("Blend Equation Support : %s\n", |
| 739 kBlendEquationSupportNames[fBlendEquationSupport]); |
726 r.appendf("Map Buffer Support : %s\n", | 740 r.appendf("Map Buffer Support : %s\n", |
727 map_flags_to_string(fMapBufferFlags).c_str()); | 741 map_flags_to_string(fMapBufferFlags).c_str()); |
728 | 742 |
729 static const char* kConfigNames[] = { | 743 static const char* kConfigNames[] = { |
730 "Unknown", // kUnknown_GrPixelConfig | 744 "Unknown", // kUnknown_GrPixelConfig |
731 "Alpha8", // kAlpha_8_GrPixelConfig, | 745 "Alpha8", // kAlpha_8_GrPixelConfig, |
732 "Index8", // kIndex_8_GrPixelConfig, | 746 "Index8", // kIndex_8_GrPixelConfig, |
733 "RGB565", // kRGB_565_GrPixelConfig, | 747 "RGB565", // kRGB_565_GrPixelConfig, |
734 "RGBA444", // kRGBA_4444_GrPixelConfig, | 748 "RGBA444", // kRGBA_4444_GrPixelConfig, |
735 "RGBA8888", // kRGBA_8888_GrPixelConfig, | 749 "RGBA8888", // kRGBA_8888_GrPixelConfig, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 799 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
786 GrPipelineBuilder::AutoRestoreStencil* ars, | 800 GrPipelineBuilder::AutoRestoreStencil* ars, |
787 GrScissorState* scissorState, | 801 GrScissorState* scissorState, |
788 const SkRect* devBounds) { | 802 const SkRect* devBounds) { |
789 return fClipMaskManager.setupClipping(pipelineBuilder, | 803 return fClipMaskManager.setupClipping(pipelineBuilder, |
790 arfp, | 804 arfp, |
791 ars, | 805 ars, |
792 scissorState, | 806 scissorState, |
793 devBounds); | 807 devBounds); |
794 } | 808 } |
OLD | NEW |