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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 719793002: Clean up CollectLayers code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 2a839a95762fa07ec070b8e4c956986e32bf8c53..9075e508f77a053854e991b580c82c18bae50566 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -186,7 +186,6 @@ public:
unsigned currentOp() const { return fCurrentOp; }
const SkMatrix& ctm() const { return *fCTM; }
- const Bounds& currentClipBounds() const { return fCurrentClipBounds; }
const Bounds& getBounds(unsigned index) const { return fBounds[index]; }
// Adjust rect for all paints that may affect its geometry, then map it to identity space.
@@ -602,20 +601,17 @@ public:
private:
struct SaveLayerInfo {
SaveLayerInfo() { }
- SaveLayerInfo(int opIndex, bool isSaveLayer, const SkPaint* paint,
- const FillBounds::Bounds& clipBound)
+ SaveLayerInfo(int opIndex, bool isSaveLayer, const SkPaint* paint)
: fStartIndex(opIndex)
, fIsSaveLayer(isSaveLayer)
, fHasNestedSaveLayer(false)
- , fPaint(paint)
- , fClipBound(clipBound) {
+ , fPaint(paint) {
}
int fStartIndex;
bool fIsSaveLayer;
bool fHasNestedSaveLayer;
const SkPaint* fPaint;
- FillBounds::Bounds fClipBound;
};
template <typename T> void trackSaveLayers(const T& op) {
@@ -645,9 +641,8 @@ private:
for (int i = 0; i < childData->numSaveLayers(); ++i) {
const GrAccelData::SaveLayerInfo& src = childData->saveLayerInfo(i);
- FillBounds::Bounds newClip(fFillBounds.currentClipBounds());
-
- if (!newClip.intersect(fFillBounds.adjustAndMap(src.fBounds, dp.paint))) {
+ FillBounds::Bounds newBound = fFillBounds.adjustAndMap(src.fBounds, dp.paint);
+ if (newBound.isEmpty()) {
continue;
}
@@ -659,7 +654,7 @@ private:
// it belongs to a sub-picture.
dst.fPicture = src.fPicture ? src.fPicture : static_cast<const SkPicture*>(dp.picture);
dst.fPicture->ref();
- dst.fBounds = newClip;
+ dst.fBounds = newBound;
dst.fLocalMat = src.fLocalMat;
dst.fPreMat = src.fPreMat;
dst.fPreMat.postConcat(fFillBounds.ctm());
@@ -693,8 +688,7 @@ private:
++fSaveLayersInStack;
}
- fSaveLayerStack.push(SaveLayerInfo(fFillBounds.currentOp(), isSaveLayer, paint,
- fFillBounds.currentClipBounds()));
+ fSaveLayerStack.push(SaveLayerInfo(fFillBounds.currentOp(), isSaveLayer, paint));
}
void popSaveLayerInfo() {
@@ -717,7 +711,6 @@ private:
SkASSERT(NULL == slInfo.fPicture); // This layer is in the top-most picture
slInfo.fBounds = fFillBounds.getBounds(sli.fStartIndex);
- slInfo.fBounds.intersect(sli.fClipBound);
slInfo.fLocalMat = fFillBounds.ctm();
slInfo.fPreMat = SkMatrix::I();
if (sli.fPaint) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698