Fix for skp chunk sizes when clips are used outside of any save
https://codereview.appspot.com/7342047/ git-svn-id: http://skia.googlecode.com/svn/trunk@7917 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
43c0ac9ca8
commit
4310c66ed4
@ -554,6 +554,7 @@ void SkPictureRecord::recordRestoreOffsetPlaceholder(SkRegion::Op op) {
|
||||
bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
|
||||
// id + rect + clip params
|
||||
uint32_t size = 1 * kUInt32Size + sizeof(rect) + 1 * kUInt32Size;
|
||||
// recordRestoreOffsetPlaceholder doesn't always write an offset
|
||||
if (!fRestoreOffsetStack.isEmpty()) {
|
||||
// + restore offset
|
||||
size += kUInt32Size;
|
||||
@ -574,6 +575,7 @@ bool SkPictureRecord::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA
|
||||
|
||||
// op + rrect + clip params
|
||||
uint32_t size = 1 * kUInt32Size + SkRRect::kSizeInMemory + 1 * kUInt32Size;
|
||||
// recordRestoreOffsetPlaceholder doesn't always write an offset
|
||||
if (!fRestoreOffsetStack.isEmpty()) {
|
||||
// + restore offset
|
||||
size += kUInt32Size;
|
||||
@ -601,6 +603,7 @@ bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
|
||||
|
||||
// op + path index + clip params
|
||||
uint32_t size = 3 * kUInt32Size;
|
||||
// recordRestoreOffsetPlaceholder doesn't always write an offset
|
||||
if (!fRestoreOffsetStack.isEmpty()) {
|
||||
// + restore offset
|
||||
size += kUInt32Size;
|
||||
@ -622,6 +625,7 @@ bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
|
||||
bool SkPictureRecord::clipRegion(const SkRegion& region, SkRegion::Op op) {
|
||||
// op + region index + clip params
|
||||
uint32_t size = 3 * kUInt32Size;
|
||||
// recordRestoreOffsetPlaceholder doesn't always write an offset
|
||||
if (!fRestoreOffsetStack.isEmpty()) {
|
||||
// + restore offset
|
||||
size += kUInt32Size;
|
||||
|
Loading…
Reference in New Issue
Block a user