diff options
author | 2014-12-16 08:25:55 -0800 | |
---|---|---|
committer | 2014-12-16 08:25:55 -0800 | |
commit | 478dd723362fefc2023aee03e11216d913eeac03 (patch) | |
tree | 9034d8c0bbd402a9b6054c4664e886ac5ad18573 /src/core/SkLayerInfo.h | |
parent | 29097f920af253db39a972ca310316217ded50f9 (diff) |
Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:
For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.
The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and carried around in
GrCachedLayer.
Filtered layers must use exact matches. This is now done in GrLayerCache::lock.
The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.
Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.
Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3
Review URL: https://codereview.chromium.org/803183003
Diffstat (limited to 'src/core/SkLayerInfo.h')
-rw-r--r-- | src/core/SkLayerInfo.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkLayerInfo.h b/src/core/SkLayerInfo.h index add57d780c..a47c3f1199 100644 --- a/src/core/SkLayerInfo.h +++ b/src/core/SkLayerInfo.h @@ -28,6 +28,9 @@ public: const SkPicture* fPicture; // The device space bounds of this layer. SkRect fBounds; + // If not-empty, the optional bounds parameter passed in to the saveLayer + // call. + SkRect fSrcBounds; // The pre-matrix begins as the identity and accumulates the transforms // of the containing SkPictures (if any). This matrix state has to be // part of the initial matrix during replay so that it will be |