| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |