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

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

Issue 291913004: formalize named picture versions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | « src/core/SkReadBuffer.cpp ('k') | src/effects/SkDashPathEffect.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkEmptyShader.h" 9 #include "SkEmptyShader.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 : fColor(c) { 248 : fColor(c) {
249 } 249 }
250 250
251 bool SkColorShader::isOpaque() const { 251 bool SkColorShader::isOpaque() const {
252 return SkColorGetA(fColor) == 255; 252 return SkColorGetA(fColor) == 255;
253 } 253 }
254 254
255 SkColorShader::SkColorShader(SkReadBuffer& b) : INHERITED(b) { 255 SkColorShader::SkColorShader(SkReadBuffer& b) : INHERITED(b) {
256 // V25_COMPATIBILITY_CODE We had a boolean to make the color shader inherit the paint's 256 // V25_COMPATIBILITY_CODE We had a boolean to make the color shader inherit the paint's
257 // color. We don't support that any more. 257 // color. We don't support that any more.
258 if (b.pictureVersion() < 26 && 0 != b.pictureVersion()) { 258 if (b.isVersionLT(SkReadBuffer::kColorShaderNoBool_Version)) {
259 if (b.readBool()) { 259 if (b.readBool()) {
260 SkDEBUGFAIL("We shouldn't have pictures that recorded the inherited case."); 260 SkDEBUGFAIL("We shouldn't have pictures that recorded the inherited case.");
261 fColor = SK_ColorWHITE; 261 fColor = SK_ColorWHITE;
262 return; 262 return;
263 } 263 }
264 } 264 }
265 fColor = b.readColor(); 265 fColor = b.readColor();
266 } 266 }
267 267
268 void SkColorShader::flatten(SkWriteBuffer& buffer) const { 268 void SkColorShader::flatten(SkWriteBuffer& buffer) const {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 #include "SkEmptyShader.h" 360 #include "SkEmptyShader.h"
361 361
362 void SkEmptyShader::toString(SkString* str) const { 362 void SkEmptyShader::toString(SkString* str) const {
363 str->append("SkEmptyShader: ("); 363 str->append("SkEmptyShader: (");
364 364
365 this->INHERITED::toString(str); 365 this->INHERITED::toString(str);
366 366
367 str->append(")"); 367 str->append(")");
368 } 368 }
369 #endif 369 #endif
OLDNEW
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698