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

Side by Side Diff: include/core/SkPaint.h

Issue 137423005: Implement a computeFastBounds() traversal for SkImageFilter. This allows for correct culling of pri… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Win build; update to ToT Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkImageFilter.h ('k') | include/effects/SkBitmapSource.h » ('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 2
3 /* 3 /*
4 * Copyright 2006 The Android Open Source Project 4 * Copyright 2006 The Android Open Source Project
5 * 5 *
6 * Use of this source code is governed by a BSD-style license that can be 6 * Use of this source code is governed by a BSD-style license that can be
7 * found in the LICENSE file. 7 * found in the LICENSE file.
8 */ 8 */
9 9
10 10
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 } 936 }
937 } 937 }
938 */ 938 */
939 const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const { 939 const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const {
940 SkPaint::Style style = this->getStyle(); 940 SkPaint::Style style = this->getStyle();
941 // ultra fast-case: filling with no effects that affect geometry 941 // ultra fast-case: filling with no effects that affect geometry
942 if (kFill_Style == style) { 942 if (kFill_Style == style) {
943 uintptr_t effects = reinterpret_cast<uintptr_t>(this->getLooper()); 943 uintptr_t effects = reinterpret_cast<uintptr_t>(this->getLooper());
944 effects |= reinterpret_cast<uintptr_t>(this->getMaskFilter()); 944 effects |= reinterpret_cast<uintptr_t>(this->getMaskFilter());
945 effects |= reinterpret_cast<uintptr_t>(this->getPathEffect()); 945 effects |= reinterpret_cast<uintptr_t>(this->getPathEffect());
946 effects |= reinterpret_cast<uintptr_t>(this->getImageFilter());
946 if (!effects) { 947 if (!effects) {
947 return orig; 948 return orig;
948 } 949 }
949 } 950 }
950 951
951 return this->doComputeFastBounds(orig, storage, style); 952 return this->doComputeFastBounds(orig, storage, style);
952 } 953 }
953 954
954 const SkRect& computeFastStrokeBounds(const SkRect& orig, 955 const SkRect& computeFastStrokeBounds(const SkRect& orig,
955 SkRect* storage) const { 956 SkRect* storage) const {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 #ifdef SK_BUILD_FOR_ANDROID 1078 #ifdef SK_BUILD_FOR_ANDROID
1078 SkPaintOptionsAndroid fPaintOptionsAndroid; 1079 SkPaintOptionsAndroid fPaintOptionsAndroid;
1079 1080
1080 // In order for the == operator to work properly this must be the last field 1081 // In order for the == operator to work properly this must be the last field
1081 // in the struct so that we can do a memcmp to this field's offset. 1082 // in the struct so that we can do a memcmp to this field's offset.
1082 uint32_t fGenerationID; 1083 uint32_t fGenerationID;
1083 #endif 1084 #endif
1084 }; 1085 };
1085 1086
1086 #endif 1087 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageFilter.h ('k') | include/effects/SkBitmapSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698