diff options
author | 2016-08-19 13:29:27 -0700 | |
---|---|---|
committer | 2016-08-19 13:29:27 -0700 | |
commit | 02fa32c6d1ef4b7b05aa06df8be4add42a1712d3 (patch) | |
tree | ba662b2b0c881a0b4f86f0de97942651eded6d6c /src | |
parent | 3688bfa710d4519c2d306a76bf5500481c1d1559 (diff) |
Move GrFixedClip into src directory
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254343003
Review-Url: https://codereview.chromium.org/2254343003
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkImageFilter.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkAlphaThresholdFilter.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkGpuBlurUtils.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 1 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 1 | ||||
-rw-r--r-- | src/gpu/GrBlurUtils.cpp | 1 | ||||
-rw-r--r-- | src/gpu/GrClipStackClip.cpp | 1 | ||||
-rw-r--r-- | src/gpu/GrClipStackClip.h | 5 | ||||
-rw-r--r-- | src/gpu/GrDrawContext.cpp | 1 | ||||
-rw-r--r-- | src/gpu/GrFixedClip.cpp (renamed from src/gpu/GrClip.cpp) | 10 | ||||
-rw-r--r-- | src/gpu/GrFixedClip.h | 50 | ||||
-rw-r--r-- | src/gpu/batches/GrDefaultPathRenderer.cpp | 1 | ||||
-rw-r--r-- | src/gpu/batches/GrMSAAPathRenderer.cpp | 1 | ||||
-rw-r--r-- | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp | 1 |
14 files changed, 65 insertions, 11 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index bf6fa96540..b2c04450ff 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -21,6 +21,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrDrawContext.h" +#include "GrFixedClip.h" #endif #ifndef SK_IGNORE_TO_STRING diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index 0871d2bc6e..5170a3d098 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -17,6 +17,7 @@ #include "GrAlphaThresholdFragmentProcessor.h" #include "GrContext.h" #include "GrDrawContext.h" +#include "GrFixedClip.h" #endif class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter { diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp index ebb480d3df..ca762e88e3 100644 --- a/src/effects/SkGpuBlurUtils.cpp +++ b/src/effects/SkGpuBlurUtils.cpp @@ -15,6 +15,7 @@ #include "GrContext.h" #include "GrCaps.h" #include "GrDrawContext.h" +#include "GrFixedClip.h" #define MAX_BLUR_SIGMA 4.0f diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index a9e833539c..5e5aca96af 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -17,6 +17,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrDrawContext.h" +#include "GrFixedClip.h" #include "GrFragmentProcessor.h" #include "GrInvariantOutput.h" #include "GrPaint.h" diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index d5c3a2d190..cdc236b63a 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -18,6 +18,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrDrawContext.h" +#include "GrFixedClip.h" #include "GrInvariantOutput.h" #include "GrTexture.h" #include "SkGr.h" diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index b99cb34e5d..2b7540da0a 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -9,6 +9,7 @@ #include "GrDrawContext.h" #include "GrCaps.h" #include "GrContext.h" +#include "GrFixedClip.h" #include "effects/GrSimpleTextureEffect.h" #include "GrStyle.h" #include "GrTexture.h" diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp index 975f56a757..695eda981f 100644 --- a/src/gpu/GrClipStackClip.cpp +++ b/src/gpu/GrClipStackClip.cpp @@ -10,6 +10,7 @@ #include "GrAppliedClip.h" #include "GrDrawingManager.h" #include "GrDrawContextPriv.h" +#include "GrFixedClip.h" #include "GrGpuResourcePriv.h" #include "GrRenderTargetPriv.h" #include "GrStencilAttachment.h" diff --git a/src/gpu/GrClipStackClip.h b/src/gpu/GrClipStackClip.h index 15025471d2..cb1f683702 100644 --- a/src/gpu/GrClipStackClip.h +++ b/src/gpu/GrClipStackClip.h @@ -8,12 +8,13 @@ #define GrClipStackClip_DEFINED #include "GrClip.h" - #include "GrReducedClip.h" #include "SkClipStack.h" -class GrTextureProvider; class GrPathRenderer; +class GrTexture; +class GrTextureProvider; +class GrUniqueKey; /** * GrClipStackClip can apply a generic SkClipStack to the draw state. It may need to generate an diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index db14498962..9e80f732c2 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -10,6 +10,7 @@ #include "GrDrawContext.h" #include "GrDrawContextPriv.h" #include "GrDrawingManager.h" +#include "GrFixedClip.h" #include "GrGpuResourcePriv.h" #include "GrOvalRenderer.h" #include "GrPathRenderer.h" diff --git a/src/gpu/GrClip.cpp b/src/gpu/GrFixedClip.cpp index f89a366963..c42214b271 100644 --- a/src/gpu/GrClip.cpp +++ b/src/gpu/GrFixedClip.cpp @@ -5,19 +5,11 @@ * found in the LICENSE file. */ -#include "GrClip.h" +#include "GrFixedClip.h" #include "GrAppliedClip.h" #include "GrDrawContext.h" -void GrNoClip::getConservativeBounds(int width, int height, SkIRect* devResult, - bool* isIntersectionOfRects) const { - devResult->setXYWH(0, 0, width, height); - if (isIntersectionOfRects) { - *isIntersectionOfRects = true; - } -} - bool GrFixedClip::quickContains(const SkRect& rect) const { if (fHasStencilClip) { return false; diff --git a/src/gpu/GrFixedClip.h b/src/gpu/GrFixedClip.h new file mode 100644 index 0000000000..01498c1161 --- /dev/null +++ b/src/gpu/GrFixedClip.h @@ -0,0 +1,50 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrFixedClip_DEFINED +#define GrFixedClip_DEFINED + +#include "GrClip.h" +#include "GrTypesPriv.h" + +/** + * GrFixedClip is a clip that can be represented by fixed-function hardware. It never modifies the + * stencil buffer itself, but can be configured to use whatever clip is already there. + */ +class GrFixedClip final : public GrClip { +public: + GrFixedClip() : fHasStencilClip(false) {} + GrFixedClip(const SkIRect& scissorRect) + : fScissorState(scissorRect) + , fHasStencilClip(false) {} + + void reset() { + fScissorState.setDisabled(); + fHasStencilClip = false; + } + + void reset(const SkIRect& scissorRect) { + fScissorState.set(scissorRect); + fHasStencilClip = false; + } + + void enableStencilClip() { fHasStencilClip = true; } + void disableStencilClip() { fHasStencilClip = false; } + + bool quickContains(const SkRect&) const final; + void getConservativeBounds(int width, int height, SkIRect* devResult, + bool* isIntersectionOfRects) const final; + +private: + bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSettings, + GrAppliedClip* out) const final; + + GrScissorState fScissorState; + bool fHasStencilClip; +}; + +#endif diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp index 7954716059..7dbdd4b48f 100644 --- a/src/gpu/batches/GrDefaultPathRenderer.cpp +++ b/src/gpu/batches/GrDefaultPathRenderer.cpp @@ -11,6 +11,7 @@ #include "GrBatchTest.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrFixedClip.h" #include "GrMesh.h" #include "GrPathUtils.h" #include "GrPipelineBuilder.h" diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp index 05a23a1e05..d6b5578d8a 100644 --- a/src/gpu/batches/GrMSAAPathRenderer.cpp +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp @@ -11,6 +11,7 @@ #include "GrBatchFlushState.h" #include "GrClip.h" #include "GrDefaultGeoProcFactory.h" +#include "GrFixedClip.h" #include "GrPathStencilSettings.h" #include "GrPathUtils.h" #include "GrPipelineBuilder.h" diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp index 5d280efac2..4f2c6b35b6 100644 --- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp +++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp @@ -11,6 +11,7 @@ #include "GrContext.h" #include "GrDrawContextPriv.h" #include "GrDrawPathBatch.h" +#include "GrFixedClip.h" #include "GrGpu.h" #include "GrPath.h" #include "GrPipelineBuilder.h" |