Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/gpu/GrClip.cpp

Issue 2035823002: Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrClip.cpp
diff --git a/src/gpu/GrClip.cpp b/src/gpu/GrClip.cpp
index eeb105e2cbf9f5ad731829d3bcd57131780ddaa3..d74d93558597030f7fde31fa06c66d7aa857ff07 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);
}

Powered by Google App Engine
This is Rietveld 408576698