aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClip.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-06-03 10:59:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-03 10:59:20 -0700
commit976f5f0dc5e907d1ca50685fad117bd15d7fc87b (patch)
treee1e1499da0cd5dfb990de560dcc1b6288c26616b /src/gpu/GrClip.cpp
parentadf5afa628adb62a0ad451d07ef1442381a0ee20 (diff)
Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack
This will be followed up with a CL to remove the GrRenderTarget from the GrPipelineBuilder. Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035823002 Review-Url: https://codereview.chromium.org/2035823002
Diffstat (limited to 'src/gpu/GrClip.cpp')
-rw-r--r--src/gpu/GrClip.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gpu/GrClip.cpp b/src/gpu/GrClip.cpp
index eeb105e2cb..d74d935585 100644
--- a/src/gpu/GrClip.cpp
+++ b/src/gpu/GrClip.cpp
@@ -8,6 +8,7 @@
#include "GrClip.h"
#include "GrClipMaskManager.h"
+#include "GrDrawContext.h"
void GrNoClip::getConservativeBounds(int width, int height, SkIRect* devResult,
bool* isIntersectionOfRects) const {
@@ -40,13 +41,13 @@ void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResul
}
}
-bool GrFixedClip::apply(GrClipMaskManager*, const GrPipelineBuilder& pipelineBuilder,
+bool GrFixedClip::apply(GrContext*, const GrPipelineBuilder& pipelineBuilder,
+ GrDrawContext* drawContext,
const SkRect* devBounds, GrAppliedClip* out) const {
if (fScissorState.enabled()) {
- const GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
SkIRect tightScissor;
if (!tightScissor.intersect(fScissorState.rect(),
- SkIRect::MakeWH(rt->width(), rt->height()))) {
+ SkIRect::MakeWH(drawContext->width(), drawContext->height()))) {
return false;
}
if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) {
@@ -83,9 +84,9 @@ void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR
devBounds.roundOut(devResult);
}
-bool GrClipStackClip::apply(GrClipMaskManager* clipMaskManager,
- const GrPipelineBuilder& pipelineBuilder, const SkRect* devBounds,
- GrAppliedClip* out) const {
- // TODO: Collapse ClipMaskManager into this class.(?)
- return clipMaskManager->setupClipping(pipelineBuilder, *this, devBounds, out);
+bool GrClipStackClip::apply(GrContext* context,
+ const GrPipelineBuilder& pipelineBuilder, GrDrawContext* drawContext,
+ const SkRect* devBounds, GrAppliedClip* out) const {
+ return GrClipMaskManager::SetupClipping(context, pipelineBuilder, drawContext,
+ *this, devBounds, out);
}