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 "SkTransparentShader.h" | 10 #include "SkTransparentShader.h" |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkString.h" | 12 #include "SkString.h" |
13 | 13 |
14 SkShader::Context* SkTransparentShader::createContext(const ContextRec& rec, voi
d* storage) const { | 14 SkShader::Context* SkTransparentShader::onCreateContext(const ContextRec& rec, |
15 if (!this->validContext(rec)) { | 15 void* storage) const { |
16 return NULL; | |
17 } | |
18 | |
19 return SkNEW_PLACEMENT_ARGS(storage, TransparentShaderContext, (*this, rec))
; | 16 return SkNEW_PLACEMENT_ARGS(storage, TransparentShaderContext, (*this, rec))
; |
20 } | 17 } |
21 | 18 |
22 size_t SkTransparentShader::contextSize() const { | 19 size_t SkTransparentShader::contextSize() const { |
23 return sizeof(TransparentShaderContext); | 20 return sizeof(TransparentShaderContext); |
24 } | 21 } |
25 | 22 |
26 SkTransparentShader::TransparentShaderContext::TransparentShaderContext( | 23 SkTransparentShader::TransparentShaderContext::TransparentShaderContext( |
27 const SkTransparentShader& shader, const ContextRec& rec) | 24 const SkTransparentShader& shader, const ContextRec& rec) |
28 : INHERITED(shader, rec) | 25 : INHERITED(shader, rec) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 117 |
121 #ifndef SK_IGNORE_TO_STRING | 118 #ifndef SK_IGNORE_TO_STRING |
122 void SkTransparentShader::toString(SkString* str) const { | 119 void SkTransparentShader::toString(SkString* str) const { |
123 str->append("SkTransparentShader: ("); | 120 str->append("SkTransparentShader: ("); |
124 | 121 |
125 this->INHERITED::toString(str); | 122 this->INHERITED::toString(str); |
126 | 123 |
127 str->append(")"); | 124 str->append(")"); |
128 } | 125 } |
129 #endif | 126 #endif |
OLD | NEW |