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

Unified Diff: src/gpu/GrFixedClip.cpp

Issue 2312173002: Revert of Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Created 4 years, 3 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
« no previous file with comments | « src/gpu/GrFixedClip.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFixedClip.cpp
diff --git a/src/gpu/GrFixedClip.cpp b/src/gpu/GrFixedClip.cpp
index 7385028bafb0197e61baae0f8bac1372259368d4..ebdd49bbf80f1ea789c8d1a5b61a94337ecf035a 100644
--- a/src/gpu/GrFixedClip.cpp
+++ b/src/gpu/GrFixedClip.cpp
@@ -10,45 +10,25 @@
#include "GrAppliedClip.h"
#include "GrDrawContext.h"
-bool GrFixedClip::quickContains(const SkRect& rect) const {
- if (fWindowRectsState.enabled()) {
- return false;
- }
- return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect(), rect);
-}
-
-void GrFixedClip::getConservativeBounds(int w, int h, SkIRect* devResult, bool* iior) const {
- devResult->setXYWH(0, 0, w, h);
+void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResult,
+ bool* isIntersectionOfRects) const {
+ devResult->setXYWH(0, 0, width, height);
if (fScissorState.enabled()) {
if (!devResult->intersect(fScissorState.rect())) {
devResult->setEmpty();
}
}
- if (iior) {
- *iior = true;
+ if (isIntersectionOfRects) {
+ *isIntersectionOfRects = true;
}
}
-bool GrFixedClip::isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const {
- if (fWindowRectsState.enabled()) {
- return false;
- }
+bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, bool isHWAntiAlias,
+ bool hasUserStencilSettings, GrAppliedClip* out) const {
if (fScissorState.enabled()) {
- SkRect rect = SkRect::Make(fScissorState.rect());
- if (!rect.intersects(rtBounds)) {
- return false;
- }
- rr->setRect(rect);
- *aa = false;
- return true;
- }
- return false;
-};
-
-bool GrFixedClip::apply(GrContext*, GrDrawContext* dc, bool, bool, GrAppliedClip* out) const {
- if (fScissorState.enabled()) {
- SkIRect tightScissor = SkIRect::MakeWH(dc->width(), dc->height());
- if (!tightScissor.intersect(fScissorState.rect())) {
+ SkIRect tightScissor;
+ if (!tightScissor.intersect(fScissorState.rect(),
+ SkIRect::MakeWH(drawContext->width(), drawContext->height()))) {
return false;
}
if (IsOutsideClip(tightScissor, out->clippedDrawBounds())) {
@@ -59,10 +39,6 @@
}
}
- if (fWindowRectsState.enabled()) {
- out->addWindowRectangles(fWindowRectsState);
- }
-
return true;
}
« no previous file with comments | « src/gpu/GrFixedClip.h ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698