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

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

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
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 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 this->setTextEncoding(static_cast<SkPaint::TextEncoding>(buffer.readUInt ())); 2165 this->setTextEncoding(static_cast<SkPaint::TextEncoding>(buffer.readUInt ()));
2166 } 2166 }
2167 2167
2168 if (flatFlags & kHasTypeface_FlatFlag) { 2168 if (flatFlags & kHasTypeface_FlatFlag) {
2169 this->setTypeface(buffer.readTypeface()); 2169 this->setTypeface(buffer.readTypeface());
2170 } else { 2170 } else {
2171 this->setTypeface(NULL); 2171 this->setTypeface(NULL);
2172 } 2172 }
2173 2173
2174 if (flatFlags & kHasEffects_FlatFlag) { 2174 if (flatFlags & kHasEffects_FlatFlag) {
2175 SkSafeUnref(this->setPathEffect(buffer.readFlattenableT<SkPathEffect>()) ); 2175 SkSafeUnref(this->setPathEffect(buffer.readPathEffect()));
2176 SkSafeUnref(this->setShader(buffer.readFlattenableT<SkShader>())); 2176 SkSafeUnref(this->setShader(buffer.readShader()));
2177 SkSafeUnref(this->setXfermode(buffer.readFlattenableT<SkXfermode>())); 2177 SkSafeUnref(this->setXfermode(buffer.readXfermode()));
2178 SkSafeUnref(this->setMaskFilter(buffer.readFlattenableT<SkMaskFilter>()) ); 2178 SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter()));
2179 SkSafeUnref(this->setColorFilter(buffer.readFlattenableT<SkColorFilter>( ))); 2179 SkSafeUnref(this->setColorFilter(buffer.readColorFilter()));
2180 SkSafeUnref(this->setRasterizer(buffer.readFlattenableT<SkRasterizer>()) ); 2180 SkSafeUnref(this->setRasterizer(buffer.readRasterizer()));
2181 SkSafeUnref(this->setLooper(buffer.readFlattenableT<SkDrawLooper>())); 2181 SkSafeUnref(this->setLooper(buffer.readDrawLooper()));
2182 SkSafeUnref(this->setImageFilter(buffer.readFlattenableT<SkImageFilter>( ))); 2182 SkSafeUnref(this->setImageFilter(buffer.readImageFilter()));
2183 SkSafeUnref(this->setAnnotation(buffer.readFlattenableT<SkAnnotation>()) ); 2183 SkSafeUnref(this->setAnnotation(buffer.readAnnotation()));
2184 } else { 2184 } else {
2185 this->setPathEffect(NULL); 2185 this->setPathEffect(NULL);
2186 this->setShader(NULL); 2186 this->setShader(NULL);
2187 this->setXfermode(NULL); 2187 this->setXfermode(NULL);
2188 this->setMaskFilter(NULL); 2188 this->setMaskFilter(NULL);
2189 this->setColorFilter(NULL); 2189 this->setColorFilter(NULL);
2190 this->setRasterizer(NULL); 2190 this->setRasterizer(NULL);
2191 this->setLooper(NULL); 2191 this->setLooper(NULL);
2192 this->setImageFilter(NULL); 2192 this->setImageFilter(NULL);
2193 } 2193 }
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 case SkXfermode::kPlus_Mode: 2595 case SkXfermode::kPlus_Mode:
2596 return 0 == this->getAlpha(); 2596 return 0 == this->getAlpha();
2597 case SkXfermode::kDst_Mode: 2597 case SkXfermode::kDst_Mode:
2598 return true; 2598 return true;
2599 default: 2599 default:
2600 break; 2600 break;
2601 } 2601 }
2602 } 2602 }
2603 return false; 2603 return false;
2604 } 2604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698