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

Unified Diff: include/gpu/GrClip.h

Issue 989443003: Remove rect clip type from grclip. (Closed) Base URL: https://skia.googlesource.com/skia.git@clipfix
Patch Set: Created 5 years, 9 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 | « no previous file | src/gpu/GrClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrClip.h
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index e8f42a231765e3969d5db48f12049cb47822b8b0..f260f05cc70c2f42fe090a8c557b4f57fcaf05e8 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -34,9 +34,12 @@ public:
fClip.fIRect = rect;
}
- GrClip(const SkRect& rect) : fClipType(kRect_ClipType) {
+ GrClip(const SkRect& rect) : fClipType(kIRect_ClipType) {
fOrigin.setZero();
- fClip.fRect = rect;
+ fClip.fIRect.fLeft = SkScalarRoundToInt(rect.fLeft);
+ fClip.fIRect.fTop = SkScalarRoundToInt(rect.fTop);
+ fClip.fIRect.fRight = SkScalarRoundToInt(rect.fRight);
+ fClip.fIRect.fBottom = SkScalarRoundToInt(rect.fBottom);
}
~GrClip() { this->reset(); }
@@ -56,10 +59,6 @@ public:
fClip.fIRect = other.irect();
fOrigin.setZero();
break;
- case kRect_ClipType:
- fClip.fRect = other.rect();
- fOrigin.setZero();
- break;
}
return *this;
}
@@ -86,9 +85,6 @@ public:
case kIRect_ClipType:
return this->irect() == other.irect();
break;
- case kRect_ClipType:
- return this->rect() == other.rect();
- break;
}
}
@@ -122,11 +118,6 @@ public:
return fClip.fIRect;
}
- const SkRect& rect() const {
- SkASSERT(kRect_ClipType == fClipType);
- return fClip.fRect;
- }
-
void reset() {
if (kClipStack_ClipType == fClipType) {
fClip.fStack->unref();
@@ -146,15 +137,13 @@ public:
bool isWideOpen(const SkRect& rect) const {
return (kWideOpen_ClipType == fClipType) ||
(kClipStack_ClipType == fClipType && this->clipStack()->isWideOpen()) ||
- (kIRect_ClipType == fClipType && this->irect().contains(rect)) ||
- (kRect_ClipType == fClipType && this->rect().contains(rect));
+ (kIRect_ClipType == fClipType && this->irect().contains(rect));
}
bool isWideOpen(const SkIRect& rect) const {
return (kWideOpen_ClipType == fClipType) ||
(kClipStack_ClipType == fClipType && this->clipStack()->isWideOpen()) ||
- (kIRect_ClipType == fClipType && this->irect().contains(rect)) ||
- (kRect_ClipType == fClipType && this->rect().contains(rect));
+ (kIRect_ClipType == fClipType && this->irect().contains(rect));
}
bool isWideOpen() const {
@@ -165,8 +154,7 @@ public:
bool quickContains(const SkRect& rect) const {
return (kWideOpen_ClipType == fClipType) ||
(kClipStack_ClipType == fClipType && this->clipStack()->quickContains(rect)) ||
- (kIRect_ClipType == fClipType && this->irect().contains(rect)) ||
- (kRect_ClipType == fClipType && this->rect().contains(rect));
+ (kIRect_ClipType == fClipType && this->irect().contains(rect));
}
void getConservativeBounds(const GrSurface* surface,
@@ -186,7 +174,6 @@ public:
kClipStack_ClipType,
kWideOpen_ClipType,
kIRect_ClipType,
- kRect_ClipType,
};
ClipType clipType() const { return fClipType; }
@@ -194,7 +181,6 @@ public:
private:
union Clip {
const SkClipStack* fStack;
- SkRect fRect;
SkIRect fIRect;
} fClip;
« no previous file with comments | « no previous file | src/gpu/GrClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698