| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 colorPtr = &storage; | 79 colorPtr = &storage; |
| 80 } | 80 } |
| 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 // We currently require 16byte alignment for some of our subclasses, so asse
rt that here. |
| 90 SkASSERT(SkIsAlign16((intptr_t)storage)); |
| 91 |
| 89 if (!this->computeTotalInverse(rec, nullptr)) { | 92 if (!this->computeTotalInverse(rec, nullptr)) { |
| 90 return nullptr; | 93 return nullptr; |
| 91 } | 94 } |
| 92 return this->onCreateContext(rec, storage); | 95 return this->onCreateContext(rec, storage); |
| 93 } | 96 } |
| 94 | 97 |
| 95 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ | 98 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const
{ |
| 96 return nullptr; | 99 return nullptr; |
| 97 } | 100 } |
| 98 | 101 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 #include "SkEmptyShader.h" | 368 #include "SkEmptyShader.h" |
| 366 | 369 |
| 367 void SkEmptyShader::toString(SkString* str) const { | 370 void SkEmptyShader::toString(SkString* str) const { |
| 368 str->append("SkEmptyShader: ("); | 371 str->append("SkEmptyShader: ("); |
| 369 | 372 |
| 370 this->INHERITED::toString(str); | 373 this->INHERITED::toString(str); |
| 371 | 374 |
| 372 str->append(")"); | 375 str->append(")"); |
| 373 } | 376 } |
| 374 #endif | 377 #endif |
| OLD | NEW |