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 "SkAtomics.h" | 8 #include "SkAtomics.h" |
9 #include "SkBitmapProcShader.h" | 9 #include "SkBitmapProcShader.h" |
10 #include "SkColorShader.h" | 10 #include "SkColorShader.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (this->onAsLuminanceColor(colorPtr)) { | 81 if (this->onAsLuminanceColor(colorPtr)) { |
82 *colorPtr = SkColorSetA(*colorPtr, 0xFF); // we only return opaque | 82 *colorPtr = SkColorSetA(*colorPtr, 0xFF); // we only return opaque |
83 return true; | 83 return true; |
84 } | 84 } |
85 return false; | 85 return false; |
86 } | 86 } |
87 | 87 |
88 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage)
const { | 88 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage)
const { |
89 // Currently we require each context to be allocated on 16byte boundary as s
ome of our | 89 // Currently we require each context to be allocated on 16byte boundary as s
ome of our |
90 // subclasses need that. Hence we check the ptr here. | 90 // subclasses need that. Hence we check the ptr here. |
91 SkASSERT(SkIsAlign16((intptr_t)storage)); | 91 // SkASSERT(SkIsAlign16((intptr_t)storage)); |
92 | 92 |
93 if (!this->computeTotalInverse(rec, nullptr)) { | 93 if (!this->computeTotalInverse(rec, nullptr)) { |
94 return nullptr; | 94 return nullptr; |
95 } | 95 } |
96 return this->onCreateContext(rec, storage); | 96 return this->onCreateContext(rec, storage); |
97 } | 97 } |
98 | 98 |
99 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ | 99 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ |
100 return nullptr; | 100 return nullptr; |
101 } | 101 } |
102 | 102 |
103 size_t SkShader::contextSize(const ContextRec& rec) const { | 103 size_t SkShader::contextSize(const ContextRec& rec) const { |
104 size_t size = this->onContextSize(rec); | 104 size_t size = this->onContextSize(rec); |
105 | 105 |
106 // Currently we require each context to be allocated on 16byte boundary as s
ome of our | 106 // Currently we require each context to be allocated on 16byte boundary as s
ome of our |
107 // subclasses need that. Hence we check the size here. | 107 // subclasses need that. Hence we check the size here. |
108 SkASSERT(SkIsAlign16(size)); | 108 // SkASSERT(SkIsAlign16(size)); |
109 | 109 |
110 return size; | 110 return size; |
111 } | 111 } |
112 | 112 |
113 size_t SkShader::onContextSize(const ContextRec&) const { | 113 size_t SkShader::onContextSize(const ContextRec&) const { |
114 return 0; | 114 return 0; |
115 } | 115 } |
116 | 116 |
117 SkShader::Context::Context(const SkShader& shader, const ContextRec& rec) | 117 SkShader::Context::Context(const SkShader& shader, const ContextRec& rec) |
118 : fShader(shader), fCTM(*rec.fMatrix) | 118 : fShader(shader), fCTM(*rec.fMatrix) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 #include "SkEmptyShader.h" | 379 #include "SkEmptyShader.h" |
380 | 380 |
381 void SkEmptyShader::toString(SkString* str) const { | 381 void SkEmptyShader::toString(SkString* str) const { |
382 str->append("SkEmptyShader: ("); | 382 str->append("SkEmptyShader: ("); |
383 | 383 |
384 this->INHERITED::toString(str); | 384 this->INHERITED::toString(str); |
385 | 385 |
386 str->append(")"); | 386 str->append(")"); |
387 } | 387 } |
388 #endif | 388 #endif |
OLD | NEW |