| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 525     fColorPOI = fPipelineBuilder->colorProcInfo(batch); | 525     fColorPOI = fPipelineBuilder->colorProcInfo(batch); | 
| 526     fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); | 526     fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); | 
| 527     if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
     POI, | 527     if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
     POI, | 
| 528                                          &fDstCopy, devBounds)) { | 528                                          &fDstCopy, devBounds)) { | 
| 529         fPipelineBuilder = NULL; | 529         fPipelineBuilder = NULL; | 
| 530     } | 530     } | 
| 531 } | 531 } | 
| 532 | 532 | 
| 533 /////////////////////////////////////////////////////////////////////////////// | 533 /////////////////////////////////////////////////////////////////////////////// | 
| 534 | 534 | 
| 535 void GrShaderCaps::reset() { | 535 GrShaderCaps::GrShaderCaps() { | 
| 536     fShaderDerivativeSupport = false; | 536     fShaderDerivativeSupport = false; | 
| 537     fGeometryShaderSupport = false; | 537     fGeometryShaderSupport = false; | 
| 538     fPathRenderingSupport = false; | 538     fPathRenderingSupport = false; | 
| 539     fDstReadInShaderSupport = false; | 539     fDstReadInShaderSupport = false; | 
| 540     fDualSourceBlendingSupport = false; | 540     fDualSourceBlendingSupport = false; | 
| 541     fMixedSamplesSupport = false; | 541     fMixedSamplesSupport = false; | 
| 542 |  | 
| 543     fShaderPrecisionVaries = false; | 542     fShaderPrecisionVaries = false; | 
| 544 } | 543 } | 
| 545 | 544 | 
| 546 GrShaderCaps& GrShaderCaps::operator=(const GrShaderCaps& other) { |  | 
| 547     fShaderDerivativeSupport = other.fShaderDerivativeSupport; |  | 
| 548     fGeometryShaderSupport = other.fGeometryShaderSupport; |  | 
| 549     fPathRenderingSupport = other.fPathRenderingSupport; |  | 
| 550     fDstReadInShaderSupport = other.fDstReadInShaderSupport; |  | 
| 551     fDualSourceBlendingSupport = other.fDualSourceBlendingSupport; |  | 
| 552     fMixedSamplesSupport = other.fMixedSamplesSupport; |  | 
| 553 |  | 
| 554     fShaderPrecisionVaries = other.fShaderPrecisionVaries; |  | 
| 555     for (int s = 0; s < kGrShaderTypeCount; ++s) { |  | 
| 556         for (int p = 0; p < kGrSLPrecisionCount; ++p) { |  | 
| 557             fFloatPrecisions[s][p] = other.fFloatPrecisions[s][p]; |  | 
| 558         } |  | 
| 559     } |  | 
| 560     return *this; |  | 
| 561 } |  | 
| 562 |  | 
| 563 static const char* shader_type_to_string(GrShaderType type) { | 545 static const char* shader_type_to_string(GrShaderType type) { | 
| 564     switch (type) { | 546     switch (type) { | 
| 565     case kVertex_GrShaderType: | 547     case kVertex_GrShaderType: | 
| 566         return "vertex"; | 548         return "vertex"; | 
| 567     case kGeometry_GrShaderType: | 549     case kGeometry_GrShaderType: | 
| 568         return "geometry"; | 550         return "geometry"; | 
| 569     case kFragment_GrShaderType: | 551     case kFragment_GrShaderType: | 
| 570         return "fragment"; | 552         return "fragment"; | 
| 571     } | 553     } | 
| 572     return ""; | 554     return ""; | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 609                     fFloatPrecisions[s][p].fBits); | 591                     fFloatPrecisions[s][p].fBits); | 
| 610             } | 592             } | 
| 611         } | 593         } | 
| 612     } | 594     } | 
| 613 | 595 | 
| 614     return r; | 596     return r; | 
| 615 } | 597 } | 
| 616 | 598 | 
| 617 /////////////////////////////////////////////////////////////////////////////// | 599 /////////////////////////////////////////////////////////////////////////////// | 
| 618 | 600 | 
| 619 void GrCaps::reset() { | 601 GrCaps::GrCaps() { | 
| 620     fMipMapSupport = false; | 602     fMipMapSupport = false; | 
| 621     fNPOTTextureTileSupport = false; | 603     fNPOTTextureTileSupport = false; | 
| 622     fTwoSidedStencilSupport = false; | 604     fTwoSidedStencilSupport = false; | 
| 623     fStencilWrapOpsSupport = false; | 605     fStencilWrapOpsSupport = false; | 
| 624     fDiscardRenderTargetSupport = false; | 606     fDiscardRenderTargetSupport = false; | 
| 625     fReuseScratchTextures = true; | 607     fReuseScratchTextures = true; | 
| 626     fGpuTracingSupport = false; | 608     fGpuTracingSupport = false; | 
| 627     fCompressedTexSubImageSupport = false; | 609     fCompressedTexSubImageSupport = false; | 
| 628     fOversizedStencilSupport = false; | 610     fOversizedStencilSupport = false; | 
| 629     fTextureBarrierSupport = false; | 611     fTextureBarrierSupport = false; | 
| 630 | 612 | 
| 631     fUseDrawInsteadOfClear = false; | 613     fUseDrawInsteadOfClear = false; | 
| 632 | 614 | 
| 633     fBlendEquationSupport = kBasic_BlendEquationSupport; | 615     fBlendEquationSupport = kBasic_BlendEquationSupport; | 
| 634     fMapBufferFlags = kNone_MapFlags; | 616     fMapBufferFlags = kNone_MapFlags; | 
| 635 | 617 | 
| 636     fMaxRenderTargetSize = 0; | 618     fMaxRenderTargetSize = 0; | 
| 637     fMaxTextureSize = 0; | 619     fMaxTextureSize = 0; | 
| 638     fMaxSampleCount = 0; | 620     fMaxSampleCount = 0; | 
| 639 | 621 | 
| 640     memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 622     memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 
| 641     memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 623     memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 
| 642 } | 624 } | 
| 643 | 625 | 
| 644 GrCaps& GrCaps::operator=(const GrCaps& other) { |  | 
| 645     fMipMapSupport = other.fMipMapSupport; |  | 
| 646     fNPOTTextureTileSupport = other.fNPOTTextureTileSupport; |  | 
| 647     fTwoSidedStencilSupport = other.fTwoSidedStencilSupport; |  | 
| 648     fStencilWrapOpsSupport = other.fStencilWrapOpsSupport; |  | 
| 649     fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport; |  | 
| 650     fReuseScratchTextures = other.fReuseScratchTextures; |  | 
| 651     fGpuTracingSupport = other.fGpuTracingSupport; |  | 
| 652     fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport; |  | 
| 653     fOversizedStencilSupport = other.fOversizedStencilSupport; |  | 
| 654     fTextureBarrierSupport = other.fTextureBarrierSupport; |  | 
| 655 |  | 
| 656     fUseDrawInsteadOfClear = other.fUseDrawInsteadOfClear; |  | 
| 657 |  | 
| 658     fBlendEquationSupport = other.fBlendEquationSupport; |  | 
| 659     fMapBufferFlags = other.fMapBufferFlags; |  | 
| 660 |  | 
| 661     fMaxRenderTargetSize = other.fMaxRenderTargetSize; |  | 
| 662     fMaxTextureSize = other.fMaxTextureSize; |  | 
| 663     fMaxSampleCount = other.fMaxSampleCount; |  | 
| 664 |  | 
| 665     memcpy(fConfigRenderSupport, other.fConfigRenderSupport, sizeof(fConfigRende
     rSupport)); |  | 
| 666     memcpy(fConfigTextureSupport, other.fConfigTextureSupport, sizeof(fConfigTex
     tureSupport)); |  | 
| 667 |  | 
| 668     return *this; |  | 
| 669 } |  | 
| 670 |  | 
| 671 static SkString map_flags_to_string(uint32_t flags) { | 626 static SkString map_flags_to_string(uint32_t flags) { | 
| 672     SkString str; | 627     SkString str; | 
| 673     if (GrCaps::kNone_MapFlags == flags) { | 628     if (GrCaps::kNone_MapFlags == flags) { | 
| 674         str = "none"; | 629         str = "none"; | 
| 675     } else { | 630     } else { | 
| 676         SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 631         SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 
| 677         SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 632         SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 
| 678         str = "can_map"; | 633         str = "can_map"; | 
| 679 | 634 | 
| 680         if (GrCaps::kSubset_MapFlag & flags) { | 635         if (GrCaps::kSubset_MapFlag & flags) { | 
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 783                              GrPipelineBuilder::AutoRestoreFragmentProcessors* a
     rfp, | 738                              GrPipelineBuilder::AutoRestoreFragmentProcessors* a
     rfp, | 
| 784                              GrPipelineBuilder::AutoRestoreStencil* ars, | 739                              GrPipelineBuilder::AutoRestoreStencil* ars, | 
| 785                              GrScissorState* scissorState, | 740                              GrScissorState* scissorState, | 
| 786                              const SkRect* devBounds) { | 741                              const SkRect* devBounds) { | 
| 787     return fClipMaskManager.setupClipping(pipelineBuilder, | 742     return fClipMaskManager.setupClipping(pipelineBuilder, | 
| 788                                           arfp, | 743                                           arfp, | 
| 789                                           ars, | 744                                           ars, | 
| 790                                           scissorState, | 745                                           scissorState, | 
| 791                                           devBounds); | 746                                           devBounds); | 
| 792 } | 747 } | 
| OLD | NEW | 
|---|