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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 total.setConcat(*rec.fMatrix, fLocalMatrix); | 72 total.setConcat(*rec.fMatrix, fLocalMatrix); |
73 | 73 |
74 const SkMatrix* m = &total; | 74 const SkMatrix* m = &total; |
75 if (rec.fLocalMatrix) { | 75 if (rec.fLocalMatrix) { |
76 total.setConcat(*m, *rec.fLocalMatrix); | 76 total.setConcat(*m, *rec.fLocalMatrix); |
77 m = &total; | 77 m = &total; |
78 } | 78 } |
79 return m->invert(totalInverse); | 79 return m->invert(totalInverse); |
80 } | 80 } |
81 | 81 |
| 82 bool SkShader::asLuminanceColor(SkColor* colorPtr) const { |
| 83 SkColor storage; |
| 84 if (NULL == colorPtr) { |
| 85 colorPtr = &storage; |
| 86 } |
| 87 if (this->onAsLuminanceColor(colorPtr)) { |
| 88 *colorPtr = SkColorSetA(*colorPtr, 0xFF); // we only return opaque |
| 89 return true; |
| 90 } |
| 91 return false; |
| 92 } |
| 93 |
82 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage)
const { | 94 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage)
const { |
83 if (!this->computeTotalInverse(rec, NULL)) { | 95 if (!this->computeTotalInverse(rec, NULL)) { |
84 return NULL; | 96 return NULL; |
85 } | 97 } |
86 return this->onCreateContext(rec, storage); | 98 return this->onCreateContext(rec, storage); |
87 } | 99 } |
88 | 100 |
89 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ | 101 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ |
90 return NULL; | 102 return NULL; |
91 } | 103 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 #include "SkEmptyShader.h" | 399 #include "SkEmptyShader.h" |
388 | 400 |
389 void SkEmptyShader::toString(SkString* str) const { | 401 void SkEmptyShader::toString(SkString* str) const { |
390 str->append("SkEmptyShader: ("); | 402 str->append("SkEmptyShader: ("); |
391 | 403 |
392 this->INHERITED::toString(str); | 404 this->INHERITED::toString(str); |
393 | 405 |
394 str->append(")"); | 406 str->append(")"); |
395 } | 407 } |
396 #endif | 408 #endif |
OLD | NEW |