aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrReducedClip.h
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-11-16 13:56:47 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-16 13:57:01 +0000
commit554c1f0508a95b5411036a95d1bb62c0d5fdeae8 (patch)
tree9a4308484386496d1ab2a30cc53893f0234b45c1 /src/gpu/GrReducedClip.h
parent63d26849701fe8cc37e181d4e0f6978063f7d269 (diff)
Revert "Fold analytic clip FPs into GrReducedClip"
This reverts commit 4355b26b359d5f2597a10012e7eb11fb3a1f025b. Reason for revert: Most likely CL for layout test failures on Chrome roll: https://bugs.chromium.org/p/chromium/issues/detail?id=785931 Original change's description: > Fold analytic clip FPs into GrReducedClip > > Perf result on Pixel phone (sorted by impact): > > GEOMEAN 7.44 -> 6.92 ms [ 93%] > > keymobi_cnn_com.skp 3.55 -> 3.59 ms [101%] > keymobi_theverge_com.skp 4.08 -> 4.13 ms [101%] > desk_skbug6850autoscroll.skp 1.21 -> 1.22 ms [101%] > ... > top25desk_weather_com.skp 14.2 -> 11.5 ms [ 81%] > keymobi_androidpolice_com_2012_.skp 3.84 -> 2.95 ms [ 77%] > keymobi_shop_mobileweb_ebay_com.skp 2.94 -> 2.26 ms [ 77%] > keymobi_boingboing_net.skp 3.08 -> 2.24 ms [ 73%] > desk_jsfiddlebigcar.skp 1.90 -> 1.25 ms [ 66%] > keymobi_m_youtube_com_watch_v_9.skp 13.5 -> 8.84 ms [ 65%] > keymobi_sfgate_com_.skp 8.55 -> 5.55 ms [ 65%] > keymobi_blogger.skp 4.01 -> 2.60 ms [ 65%] > > Cleaner code, improved skps, slightly better geometric mean time. > > Pixel C is mostly unaffected, presumably because it uses window > rectangles. > > Bug: skia:7190 > Change-Id: Ia93f68b2f971ea66b3ab19dc73557ea602932a92 > Reviewed-on: https://skia-review.googlesource.com/67424 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com Change-Id: I86ff05196eaaeca4fb63836c9b449bbea76fe80b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7190 Reviewed-on: https://skia-review.googlesource.com/72480 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrReducedClip.h')
-rw-r--r--src/gpu/GrReducedClip.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/src/gpu/GrReducedClip.h b/src/gpu/GrReducedClip.h
index 3ad2ab9971..0746439ba3 100644
--- a/src/gpu/GrReducedClip.h
+++ b/src/gpu/GrReducedClip.h
@@ -8,7 +8,6 @@
#ifndef GrReducedClip_DEFINED
#define GrReducedClip_DEFINED
-#include "GrFragmentProcessor.h"
#include "GrWindowRectangles.h"
#include "SkClipStack.h"
#include "SkTLList.h"
@@ -25,8 +24,7 @@ public:
using Element = SkClipStack::Element;
using ElementList = SkTLList<SkClipStack::Element, 16>;
- GrReducedClip(const SkClipStack&, const SkRect& queryBounds,
- int maxWindowRectangles = 0, int maxAnalyticFPs = 0);
+ GrReducedClip(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles = 0);
/**
* If hasScissor() is true, the clip mask is not valid outside this rect and the caller must
@@ -50,13 +48,6 @@ public:
*/
const GrWindowRectangles& windowRectangles() const { return fWindowRects; }
- int numAnalyticFPs() const { return fAnalyticFPs.count(); }
-
- std::unique_ptr<GrFragmentProcessor> detachAnalyticFPs() {
- SkDEBUGCODE(for (const auto& fp : fAnalyticFPs) { SkASSERT(fp); })
- return GrFragmentProcessor::RunInSeries(fAnalyticFPs.begin(), fAnalyticFPs.count());
- }
-
/**
* An ordered list of clip elements that could not be skipped or implemented by other means. If
* nonempty, the caller must create an alpha and/or stencil mask for these elements and apply it
@@ -90,7 +81,7 @@ public:
bool drawStencilClipMask(GrContext*, GrRenderTargetContext*) const;
private:
- void walkStack(const SkClipStack&, const SkRect& queryBounds);
+ void walkStack(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles);
enum class ClipResult {
kNotClipped,
@@ -100,35 +91,24 @@ private:
// Clips the the given element's interior out of the final clip.
// NOTE: do not call for elements followed by ops that can grow the clip.
- ClipResult clipInsideElement(const Element*);
+ ClipResult clipInsideElement(const Element* element);
// Clips the the given element's exterior out of the final clip.
// NOTE: do not call for elements followed by ops that can grow the clip.
- ClipResult clipOutsideElement(const Element*);
+ ClipResult clipOutsideElement(const Element* element, int maxWindowRectangles);
void addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA);
-
- enum class Invert : bool {
- kNo,
- kYes
- };
-
- template<typename T> ClipResult addAnalyticFP(const T& deviceSpaceShape, Invert, bool aa);
-
void makeEmpty();
- const int fMaxWindowRectangles;
- const int fMaxAnalyticFPs;
- SkIRect fScissor;
- bool fHasScissor;
- SkRect fAAClipRect;
- uint32_t fAAClipRectGenID; // GenID the mask will have if includes the AA clip rect.
- GrWindowRectangles fWindowRects;
- SkSTArray<4, std::unique_ptr<GrFragmentProcessor>> fAnalyticFPs;
- ElementList fMaskElements;
- uint32_t fMaskGenID;
- bool fMaskRequiresAA;
- InitialState fInitialState;
+ SkIRect fScissor;
+ bool fHasScissor;
+ SkRect fAAClipRect;
+ uint32_t fAAClipRectGenID; // GenID the mask will have if includes the AA clip rect.
+ GrWindowRectangles fWindowRects;
+ ElementList fMaskElements;
+ uint32_t fMaskGenID;
+ bool fMaskRequiresAA;
+ InitialState fInitialState;
};
#endif