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