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

Side by Side Diff: src/core/SkPictureRecord.cpp

Issue 316143003: Remove SkPicture::kUsePathBoundsForClip_RecordingFlag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add suppression for fixed GM Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkTSearch.h" 9 #include "SkTSearch.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 return offset; 856 return offset;
857 } 857 }
858 858
859 void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdg eStyle edgeStyle) { 859 void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdg eStyle edgeStyle) {
860 860
861 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 861 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
862 fMCMgr.clipRRect(rrect, op, doAA); 862 fMCMgr.clipRRect(rrect, op, doAA);
863 #else 863 #else
864 this->recordClipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle); 864 this->recordClipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
865 #endif 865 #endif
866 if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) { 866 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
867 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
868 } else {
869 this->INHERITED::onClipRRect(rrect, op, edgeStyle);
870 }
871 } 867 }
872 868
873 size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkRegion::Op op, b ool doAA) { 869 size_t SkPictureRecord::recordClipRRect(const SkRRect& rrect, SkRegion::Op op, b ool doAA) {
874 // op + rrect + clip params 870 // op + rrect + clip params
875 size_t size = 1 * kUInt32Size + SkRRect::kSizeInMemory + 1 * kUInt32Size; 871 size_t size = 1 * kUInt32Size + SkRRect::kSizeInMemory + 1 * kUInt32Size;
876 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 872 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
877 size += kUInt32Size; // + restore offset 873 size += kUInt32Size; // + restore offset
878 #else 874 #else
879 // recordRestoreOffsetPlaceholder doesn't always write an offset 875 // recordRestoreOffsetPlaceholder doesn't always write an offset
880 if (!fRestoreOffsetStack.isEmpty()) { 876 if (!fRestoreOffsetStack.isEmpty()) {
(...skipping 11 matching lines...) Expand all
892 888
893 void SkPictureRecord::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeSt yle edgeStyle) { 889 void SkPictureRecord::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeSt yle edgeStyle) {
894 890
895 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 891 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
896 fMCMgr.clipPath(path, op, doAA); 892 fMCMgr.clipPath(path, op, doAA);
897 #else 893 #else
898 int pathID = this->addPathToHeap(path); 894 int pathID = this->addPathToHeap(path);
899 this->recordClipPath(pathID, op, kSoft_ClipEdgeStyle == edgeStyle); 895 this->recordClipPath(pathID, op, kSoft_ClipEdgeStyle == edgeStyle);
900 #endif 896 #endif
901 897
902 if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) { 898 this->updateClipConservativelyUsingBounds(path.getBounds(), op,
903 this->updateClipConservativelyUsingBounds(path.getBounds(), op, 899 path.isInverseFillType());
904 path.isInverseFillType());
905 } else {
906 this->INHERITED::onClipPath(path, op, edgeStyle);
907 }
908 } 900 }
909 901
910 size_t SkPictureRecord::recordClipPath(int pathID, SkRegion::Op op, bool doAA) { 902 size_t SkPictureRecord::recordClipPath(int pathID, SkRegion::Op op, bool doAA) {
911 // op + path index + clip params 903 // op + path index + clip params
912 size_t size = 3 * kUInt32Size; 904 size_t size = 3 * kUInt32Size;
913 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 905 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
914 size += kUInt32Size; // + restore offset 906 size += kUInt32Size; // + restore offset
915 #else 907 #else
916 // recordRestoreOffsetPlaceholder doesn't always write an offset 908 // recordRestoreOffsetPlaceholder doesn't always write an offset
917 if (!fRestoreOffsetStack.isEmpty()) { 909 if (!fRestoreOffsetStack.isEmpty()) {
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 void SkPictureRecord::validateRegions() const { 1818 void SkPictureRecord::validateRegions() const {
1827 int count = fRegions.count(); 1819 int count = fRegions.count();
1828 SkASSERT((unsigned) count < 0x1000); 1820 SkASSERT((unsigned) count < 0x1000);
1829 for (int index = 0; index < count; index++) { 1821 for (int index = 0; index < count; index++) {
1830 const SkFlatData* region = fRegions[index]; 1822 const SkFlatData* region = fRegions[index];
1831 SkASSERT(region); 1823 SkASSERT(region);
1832 // region->validate(); 1824 // region->validate();
1833 } 1825 }
1834 } 1826 }
1835 #endif 1827 #endif
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698