OLD | NEW |
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 | 9 |
10 #include "SkComposeShader.h" | 10 #include "SkComposeShader.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 fShaderB = sB; sB->ref(); | 23 fShaderB = sB; sB->ref(); |
24 // mode may be null | 24 // mode may be null |
25 fMode = mode; | 25 fMode = mode; |
26 SkSafeRef(mode); | 26 SkSafeRef(mode); |
27 } | 27 } |
28 | 28 |
29 SkComposeShader::SkComposeShader(SkReadBuffer& buffer) : | 29 SkComposeShader::SkComposeShader(SkReadBuffer& buffer) : |
30 INHERITED(buffer) { | 30 INHERITED(buffer) { |
31 fShaderA = buffer.readShader(); | 31 fShaderA = buffer.readShader(); |
32 if (NULL == fShaderA) { | 32 if (NULL == fShaderA) { |
33 fShaderA = SkNEW_ARGS(SkColorShader, (0)); | 33 fShaderA = SkNEW_ARGS(SkColorShader, ((SkColor)0)); |
34 } | 34 } |
35 fShaderB = buffer.readShader(); | 35 fShaderB = buffer.readShader(); |
36 if (NULL == fShaderB) { | 36 if (NULL == fShaderB) { |
37 fShaderB = SkNEW_ARGS(SkColorShader, (0)); | 37 fShaderB = SkNEW_ARGS(SkColorShader, ((SkColor)0)); |
38 } | 38 } |
39 fMode = buffer.readXfermode(); | 39 fMode = buffer.readXfermode(); |
40 } | 40 } |
41 | 41 |
42 SkComposeShader::~SkComposeShader() { | 42 SkComposeShader::~SkComposeShader() { |
43 SkSafeUnref(fMode); | 43 SkSafeUnref(fMode); |
44 fShaderB->unref(); | 44 fShaderB->unref(); |
45 fShaderA->unref(); | 45 fShaderA->unref(); |
46 } | 46 } |
47 | 47 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 str->append(" ShaderB: "); | 212 str->append(" ShaderB: "); |
213 fShaderB->toString(str); | 213 fShaderB->toString(str); |
214 str->append(" Xfermode: "); | 214 str->append(" Xfermode: "); |
215 fMode->toString(str); | 215 fMode->toString(str); |
216 | 216 |
217 this->INHERITED::toString(str); | 217 this->INHERITED::toString(str); |
218 | 218 |
219 str->append(")"); | 219 str->append(")"); |
220 } | 220 } |
221 #endif | 221 #endif |
OLD | NEW |