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

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

Issue 181703003: Factory methods for heap-allocated SkAnnotation objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/core/SkAnnotation.cpp ('k') | src/pipe/SkGPipeRead.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 SkSafeUnref(this->setPathEffect(buffer.readPathEffect())); 2157 SkSafeUnref(this->setPathEffect(buffer.readPathEffect()));
2158 SkSafeUnref(this->setShader(buffer.readShader())); 2158 SkSafeUnref(this->setShader(buffer.readShader()));
2159 SkSafeUnref(this->setXfermode(buffer.readXfermode())); 2159 SkSafeUnref(this->setXfermode(buffer.readXfermode()));
2160 SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter())); 2160 SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter()));
2161 SkSafeUnref(this->setColorFilter(buffer.readColorFilter())); 2161 SkSafeUnref(this->setColorFilter(buffer.readColorFilter()));
2162 SkSafeUnref(this->setRasterizer(buffer.readRasterizer())); 2162 SkSafeUnref(this->setRasterizer(buffer.readRasterizer()));
2163 SkSafeUnref(this->setLooper(buffer.readDrawLooper())); 2163 SkSafeUnref(this->setLooper(buffer.readDrawLooper()));
2164 SkSafeUnref(this->setImageFilter(buffer.readImageFilter())); 2164 SkSafeUnref(this->setImageFilter(buffer.readImageFilter()));
2165 2165
2166 if (buffer.readBool()) { 2166 if (buffer.readBool()) {
2167 this->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref(); 2167 this->setAnnotation(SkAnnotation::Create(buffer))->unref();
2168 } 2168 }
2169 } else { 2169 } else {
2170 this->setPathEffect(NULL); 2170 this->setPathEffect(NULL);
2171 this->setShader(NULL); 2171 this->setShader(NULL);
2172 this->setXfermode(NULL); 2172 this->setXfermode(NULL);
2173 this->setMaskFilter(NULL); 2173 this->setMaskFilter(NULL);
2174 this->setColorFilter(NULL); 2174 this->setColorFilter(NULL);
2175 this->setRasterizer(NULL); 2175 this->setRasterizer(NULL);
2176 this->setLooper(NULL); 2176 this->setLooper(NULL);
2177 this->setImageFilter(NULL); 2177 this->setImageFilter(NULL);
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 F_UNREF(Xfermode, readXfermode); 2677 F_UNREF(Xfermode, readXfermode);
2678 F_UNREF(MaskFilter, readMaskFilter); 2678 F_UNREF(MaskFilter, readMaskFilter);
2679 F_UNREF(ColorFilter, readColorFilter); 2679 F_UNREF(ColorFilter, readColorFilter);
2680 F_UNREF(Rasterizer, readRasterizer); 2680 F_UNREF(Rasterizer, readRasterizer);
2681 F_UNREF(Looper, readDrawLooper); 2681 F_UNREF(Looper, readDrawLooper);
2682 F_UNREF(ImageFilter, readImageFilter); 2682 F_UNREF(ImageFilter, readImageFilter);
2683 F(Typeface, readTypeface); 2683 F(Typeface, readTypeface);
2684 #undef F 2684 #undef F
2685 #undef F_UNREF 2685 #undef F_UNREF
2686 if (dirty & kAnnotation_DirtyBit) { 2686 if (dirty & kAnnotation_DirtyBit) {
2687 paint->setAnnotation(SkNEW_ARGS(SkAnnotation, (buffer)))->unref(); 2687 paint->setAnnotation(SkAnnotation::Create(buffer))->unref();
2688 } 2688 }
2689 #ifdef SK_BUILD_FOR_ANDROID 2689 #ifdef SK_BUILD_FOR_ANDROID
2690 if (dirty & kPaintOptionsAndroid_DirtyBit) { 2690 if (dirty & kPaintOptionsAndroid_DirtyBit) {
2691 SkPaintOptionsAndroid options; 2691 SkPaintOptionsAndroid options;
2692 options.unflatten(buffer); 2692 options.unflatten(buffer);
2693 paint->setPaintOptionsAndroid(options); 2693 paint->setPaintOptionsAndroid(options);
2694 } 2694 }
2695 #endif 2695 #endif
2696 SkASSERT(dirty == paint->fDirtyBits); 2696 SkASSERT(dirty == paint->fDirtyBits);
2697 } 2697 }
OLDNEW
« no previous file with comments | « src/core/SkAnnotation.cpp ('k') | src/pipe/SkGPipeRead.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698