| 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 "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkMallocPixelRef.h" | 10 #include "SkMallocPixelRef.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 return m->invert(totalInverse); | 56 return m->invert(totalInverse); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool SkShader::validContext(const SkBitmap& device, | 59 bool SkShader::validContext(const SkBitmap& device, |
| 60 const SkPaint& paint, | 60 const SkPaint& paint, |
| 61 const SkMatrix& matrix, | 61 const SkMatrix& matrix, |
| 62 SkMatrix* totalInverse) const { | 62 SkMatrix* totalInverse) const { |
| 63 return this->computeTotalInverse(matrix, totalInverse); | 63 return this->computeTotalInverse(matrix, totalInverse); |
| 64 } | 64 } |
| 65 | 65 |
| 66 SkShader::Context* SkShader::createContext(const SkBitmap&, const SkPaint&, cons
t SkMatrix&, |
| 67 void* storage) const { |
| 68 // should be overridden by subclass |
| 69 return NULL; |
| 70 } |
| 71 |
| 72 size_t SkShader::contextSize() const { |
| 73 // should be overridden by subclass |
| 74 return 0; |
| 75 } |
| 76 |
| 66 SkShader::Context::Context(const SkShader& shader, const SkBitmap& device, | 77 SkShader::Context::Context(const SkShader& shader, const SkBitmap& device, |
| 67 const SkPaint& paint, const SkMatrix& matrix) | 78 const SkPaint& paint, const SkMatrix& matrix) |
| 68 : fShader(shader) | 79 : fShader(shader) |
| 69 { | 80 { |
| 70 SkASSERT(fShader.validContext(device, paint, matrix)); | 81 SkASSERT(fShader.validContext(device, paint, matrix)); |
| 71 | 82 |
| 72 // Because the context parameters must be valid at this point, we know that
the matrix is | 83 // Because the context parameters must be valid at this point, we know that
the matrix is |
| 73 // invertible. | 84 // invertible. |
| 74 SkAssertResult(fShader.computeTotalInverse(matrix, &fTotalInverse)); | 85 SkAssertResult(fShader.computeTotalInverse(matrix, &fTotalInverse)); |
| 75 fTotalInverseClass = (uint8_t)ComputeMatrixClass(fTotalInverse); | 86 fTotalInverseClass = (uint8_t)ComputeMatrixClass(fTotalInverse); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 #include "SkEmptyShader.h" | 341 #include "SkEmptyShader.h" |
| 331 | 342 |
| 332 void SkEmptyShader::toString(SkString* str) const { | 343 void SkEmptyShader::toString(SkString* str) const { |
| 333 str->append("SkEmptyShader: ("); | 344 str->append("SkEmptyShader: ("); |
| 334 | 345 |
| 335 this->INHERITED::toString(str); | 346 this->INHERITED::toString(str); |
| 336 | 347 |
| 337 str->append(")"); | 348 str->append(")"); |
| 338 } | 349 } |
| 339 #endif | 350 #endif |
| OLD | NEW |