Skip to content

Commit 1a2476d

Browse files
lhkbobSkia Commit-Bot
authored andcommitted
Revert "Initial definition of fill rect op"
This reverts commit d3c92d9. Reason for revert: <INSERT REASONING HERE> Original change's description: > Initial definition of fill rect op > > Bug: skia: > Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924 > Reviewed-on: https://skia-review.googlesource.com/c/163486 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Michael Ludwig <michaelludwig@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/c/173233 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
1 parent 85e22fc commit 1a2476d

13 files changed

+15
-895
lines changed

gm/drawquadset.cpp

Lines changed: 0 additions & 230 deletions
This file was deleted.

gn/gm.gni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ gm_sources = [
123123
"$_gm/drawlooper.cpp",
124124
"$_gm/drawimageset.cpp",
125125
"$_gm/drawminibitmaprect.cpp",
126-
"$_gm/drawquadset.cpp",
127126
"$_gm/drawregion.cpp",
128127
"$_gm/drawregionmodes.cpp",
129128
"$_gm/dropshadowimagefilter.cpp",

gn/gpu.gni

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ skia_gpu_sources = [
262262
"$_src/gpu/ops/GrDrawOp.h",
263263
"$_src/gpu/ops/GrDrawVerticesOp.cpp",
264264
"$_src/gpu/ops/GrDrawVerticesOp.h",
265-
"$_src/gpu/ops/GrFillRectOp.cpp",
266-
"$_src/gpu/ops/GrFillRectOp.h",
267265
"$_src/gpu/ops/GrMeshDrawOp.cpp",
268266
"$_src/gpu/ops/GrMeshDrawOp.h",
269267
"$_src/gpu/ops/GrNonAAFillRectOp.cpp",

src/gpu/GrProcessor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ class GrProcessor {
155155
kPorterDuffXferProcessor_ClassID,
156156
kPremulFragmentProcessor_ClassID,
157157
kQuadEdgeEffect_ClassID,
158-
kQuadPerEdgeAAGeometryProcessor_ClassID,
159158
kReplaceInputFragmentProcessor_ClassID,
160159
kRRectsGaussianEdgeFP_ClassID,
161160
kSeriesFragmentProcessor_ClassID,

src/gpu/GrQuad.cpp

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,7 @@
1919
// Allow some tolerance from floating point matrix transformations, but SkScalarNearlyEqual doesn't
2020
// support comparing infinity, and coords_form_rect should return true for infinite edges
2121
#define NEARLY_EQUAL(f1, f2) (f1 == f2 || SkScalarNearlyEqual(f1, f2, 1e-5f))
22-
// Similarly, support infinite rectangles by looking at the sign of infinities
23-
static bool dot_nearly_zero(const SkVector& e1, const SkVector& e2) {
24-
static constexpr auto dot = SkPoint::DotProduct;
25-
static constexpr auto sign = SkScalarSignAsScalar;
26-
27-
SkScalar dotValue = dot(e1, e2);
28-
if (SkScalarIsNaN(dotValue)) {
29-
// Form vectors from the signs of infinities, and check their dot product
30-
dotValue = dot({sign(e1.fX), sign(e1.fY)}, {sign(e2.fX), sign(e2.fY)});
31-
}
32-
33-
// Unfortunately must have a pretty healthy tolerance here or transformed rects that are
34-
// effectively rectilinear will have edge dot products of around .005
35-
return SkScalarNearlyZero(dotValue, 1e-2f);
36-
}
22+
#define NEARLY_ZERO(f1) NEARLY_EQUAL(f1, 0.f)
3723

3824
// This is not the most performance critical function; code using GrQuad should rely on the faster
3925
// quad type from matrix path, so this will only be called as part of SkASSERT.
@@ -45,13 +31,18 @@ static bool coords_form_rect(const float xs[4], const float ys[4]) {
4531
}
4632

4733
static bool coords_rectilinear(const float xs[4], const float ys[4]) {
34+
// Edge from 0 to 1 should have the same length as edge from 3 to 2
35+
// and edge from 1 to 3 should have the same length as edge from 2 to 0
36+
// noo that makes it a parallelogram, need dot product between edge 0 to 1 and edge 1 to 3 = 0
37+
// and 0-2 and 2-3 is 0.
38+
static constexpr auto dot = SkPoint::DotProduct;
4839
SkVector e0{xs[1] - xs[0], ys[1] - ys[0]}; // Connects to e1 and e2(repeat)
4940
SkVector e1{xs[3] - xs[1], ys[3] - ys[1]}; // connects to e0(repeat) and e3
5041
SkVector e2{xs[0] - xs[2], ys[0] - ys[2]}; // connects to e0 and e3(repeat)
5142
SkVector e3{xs[2] - xs[3], ys[2] - ys[3]}; // connects to e1(repeat) and e2
5243

53-
return dot_nearly_zero(e0, e1) && dot_nearly_zero(e1, e3) &&
54-
dot_nearly_zero(e2, e0) && dot_nearly_zero(e3, e2);
44+
return NEARLY_ZERO(dot(e0, e1)) && NEARLY_ZERO(dot(e1, e3)) &&
45+
NEARLY_ZERO(dot(e2, e0)) && NEARLY_ZERO(dot(e3, e2));
5546
}
5647

5748
GrQuadType GrQuad::quadType() const {

src/gpu/GrRenderTargetContext.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "ops/GrDrawAtlasOp.h"
4545
#include "ops/GrDrawOp.h"
4646
#include "ops/GrDrawVerticesOp.h"
47-
#include "ops/GrFillRectOp.h"
4847
#include "ops/GrAAFillRRectOp.h"
4948
#include "ops/GrLatticeOp.h"
5049
#include "ops/GrOp.h"
@@ -639,14 +638,6 @@ void GrRenderTargetContext::drawRect(const GrClip& clip,
639638
this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, GrShape(rect, *style));
640639
}
641640

642-
void GrRenderTargetContext::drawQuadSet(const GrClip& clip, GrPaint&& paint, GrAA aa,
643-
const SkMatrix& viewMatrix, const QuadSetEntry quads[],
644-
int cnt) {
645-
GrAAType aaType = this->chooseAAType(aa, GrAllowMixedSamples::kNo);
646-
this->addDrawOp(clip, GrFillRectOp::MakeSet(fContext, std::move(paint), aaType, viewMatrix,
647-
quads, cnt));
648-
}
649-
650641
int GrRenderTargetContextPriv::maxWindowRectangles() const {
651642
return fRenderTargetContext->fRenderTargetProxy->maxWindowRectangles(
652643
*fRenderTargetContext->caps());

src/gpu/GrRenderTargetContext.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,6 @@ class SK_API GrRenderTargetContext : public GrSurfaceContext {
127127
const SkRect& rect,
128128
const SkMatrix& localMatrix);
129129

130-
/** Used with drawQuadSet */
131-
struct QuadSetEntry {
132-
SkRect fRect;
133-
SkPMColor4f fColor; // Overrides any color on the GrPaint
134-
SkMatrix fLocalMatrix;
135-
GrQuadAAFlags fAAFlags;
136-
};
137-
138-
void drawQuadSet(const GrClip& clip, GrPaint&& paint, GrAA aa, const SkMatrix& viewMatrix,
139-
const QuadSetEntry[], int cnt);
140-
141130
/**
142131
* Creates an op that draws a subrectangle of a texture. The passed color is modulated by the
143132
* texture's color. 'srcRect' specifies the rectangle of the texture to draw. 'dstRect'

0 commit comments

Comments
 (0)