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 |
11 #include "GrBatch.h" | 11 #include "GrBatch.h" |
12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
13 #include "GrContext.h" | 13 #include "GrContext.h" |
| 14 #include "GrContextOptions.h" |
14 #include "GrPath.h" | 15 #include "GrPath.h" |
15 #include "GrPipeline.h" | 16 #include "GrPipeline.h" |
16 #include "GrMemoryPool.h" | 17 #include "GrMemoryPool.h" |
17 #include "GrRectBatch.h" | 18 #include "GrRectBatch.h" |
18 #include "GrRenderTarget.h" | 19 #include "GrRenderTarget.h" |
19 #include "GrRenderTargetPriv.h" | 20 #include "GrRenderTargetPriv.h" |
20 #include "GrSurfacePriv.h" | 21 #include "GrSurfacePriv.h" |
21 #include "GrTemplates.h" | 22 #include "GrTemplates.h" |
22 #include "GrTexture.h" | 23 #include "GrTexture.h" |
23 #include "GrVertexBuffer.h" | 24 #include "GrVertexBuffer.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 62 } |
62 | 63 |
63 SkIRect copyRect; | 64 SkIRect copyRect; |
64 pipelineBuilder.clip().getConservativeBounds(rt, ©Rect); | 65 pipelineBuilder.clip().getConservativeBounds(rt, ©Rect); |
65 | 66 |
66 if (drawBounds) { | 67 if (drawBounds) { |
67 SkIRect drawIBounds; | 68 SkIRect drawIBounds; |
68 drawBounds->roundOut(&drawIBounds); | 69 drawBounds->roundOut(&drawIBounds); |
69 if (!copyRect.intersect(drawIBounds)) { | 70 if (!copyRect.intersect(drawIBounds)) { |
70 #ifdef SK_DEBUG | 71 #ifdef SK_DEBUG |
71 GrContextDebugf(fContext, "Missed an early reject. " | 72 GrCapsDebugf(fCaps, "Missed an early reject. " |
72 "Bailing on draw from setupDstReadIfNecess
ary.\n"); | 73 "Bailing on draw from setupDstReadIfNecessary.\n"); |
73 #endif | 74 #endif |
74 return false; | 75 return false; |
75 } | 76 } |
76 } else { | 77 } else { |
77 #ifdef SK_DEBUG | 78 #ifdef SK_DEBUG |
78 //SkDebugf("No dev bounds when dst copy is made.\n"); | 79 //SkDebugf("No dev bounds when dst copy is made.\n"); |
79 #endif | 80 #endif |
80 } | 81 } |
81 | 82 |
82 // MSAA consideration: When there is support for reading MSAA samples in the
shader we could | 83 // MSAA consideration: When there is support for reading MSAA samples in the
shader we could |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 fFloatPrecisions[s][p].fBits); | 592 fFloatPrecisions[s][p].fBits); |
592 } | 593 } |
593 } | 594 } |
594 } | 595 } |
595 | 596 |
596 return r; | 597 return r; |
597 } | 598 } |
598 | 599 |
599 /////////////////////////////////////////////////////////////////////////////// | 600 /////////////////////////////////////////////////////////////////////////////// |
600 | 601 |
601 GrCaps::GrCaps() { | 602 GrCaps::GrCaps(const GrContextOptions& options) { |
602 fMipMapSupport = false; | 603 fMipMapSupport = false; |
603 fNPOTTextureTileSupport = false; | 604 fNPOTTextureTileSupport = false; |
604 fTwoSidedStencilSupport = false; | 605 fTwoSidedStencilSupport = false; |
605 fStencilWrapOpsSupport = false; | 606 fStencilWrapOpsSupport = false; |
606 fDiscardRenderTargetSupport = false; | 607 fDiscardRenderTargetSupport = false; |
607 fReuseScratchTextures = true; | 608 fReuseScratchTextures = true; |
608 fGpuTracingSupport = false; | 609 fGpuTracingSupport = false; |
609 fCompressedTexSubImageSupport = false; | 610 fCompressedTexSubImageSupport = false; |
610 fOversizedStencilSupport = false; | 611 fOversizedStencilSupport = false; |
611 fTextureBarrierSupport = false; | 612 fTextureBarrierSupport = false; |
612 | 613 |
613 fUseDrawInsteadOfClear = false; | 614 fUseDrawInsteadOfClear = false; |
614 | 615 |
615 fBlendEquationSupport = kBasic_BlendEquationSupport; | 616 fBlendEquationSupport = kBasic_BlendEquationSupport; |
616 fMapBufferFlags = kNone_MapFlags; | 617 fMapBufferFlags = kNone_MapFlags; |
617 | 618 |
618 fMaxRenderTargetSize = 0; | 619 fMaxRenderTargetSize = 0; |
619 fMaxTextureSize = 0; | 620 fMaxTextureSize = 0; |
620 fMaxSampleCount = 0; | 621 fMaxSampleCount = 0; |
621 | 622 |
622 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); | 623 memset(fConfigRenderSupport, 0, sizeof(fConfigRenderSupport)); |
623 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); | 624 memset(fConfigTextureSupport, 0, sizeof(fConfigTextureSupport)); |
| 625 |
| 626 fSupressPrints = options.fSuppressPrints; |
| 627 fDrawPathMasksToCompressedTextureSupport = options.fDrawPathToCompressedText
ure; |
624 } | 628 } |
625 | 629 |
626 static SkString map_flags_to_string(uint32_t flags) { | 630 static SkString map_flags_to_string(uint32_t flags) { |
627 SkString str; | 631 SkString str; |
628 if (GrCaps::kNone_MapFlags == flags) { | 632 if (GrCaps::kNone_MapFlags == flags) { |
629 str = "none"; | 633 str = "none"; |
630 } else { | 634 } else { |
631 SkASSERT(GrCaps::kCanMap_MapFlag & flags); | 635 SkASSERT(GrCaps::kCanMap_MapFlag & flags); |
632 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); | 636 SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag); |
633 str = "can_map"; | 637 str = "can_map"; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 742 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
739 GrPipelineBuilder::AutoRestoreStencil* ars, | 743 GrPipelineBuilder::AutoRestoreStencil* ars, |
740 GrScissorState* scissorState, | 744 GrScissorState* scissorState, |
741 const SkRect* devBounds) { | 745 const SkRect* devBounds) { |
742 return fClipMaskManager.setupClipping(pipelineBuilder, | 746 return fClipMaskManager.setupClipping(pipelineBuilder, |
743 arfp, | 747 arfp, |
744 ars, | 748 ars, |
745 scissorState, | 749 scissorState, |
746 devBounds); | 750 devBounds); |
747 } | 751 } |
OLD | NEW |