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 | 8 |
9 #include "SkScalar.h" | 9 #include "SkScalar.h" |
10 #include "SkShader.h" | 10 #include "SkShader.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 bool SkShader::setContext(const SkBitmap& device, | 46 bool SkShader::setContext(const SkBitmap& device, |
47 const SkPaint& paint, | 47 const SkPaint& paint, |
48 const SkMatrix& matrix) { | 48 const SkMatrix& matrix) { |
49 SkASSERT(!this->setContextHasBeenCalled()); | 49 SkASSERT(!this->setContextHasBeenCalled()); |
50 | 50 |
51 const SkMatrix* m = &matrix; | 51 const SkMatrix* m = &matrix; |
52 SkMatrix total; | 52 SkMatrix total; |
53 | 53 |
54 fDeviceConfig = SkToU8(device.getConfig()); | 54 fDeviceConfig = SkToU8(device.config()); |
55 fPaintAlpha = paint.getAlpha(); | 55 fPaintAlpha = paint.getAlpha(); |
56 if (this->hasLocalMatrix()) { | 56 if (this->hasLocalMatrix()) { |
57 total.setConcat(matrix, this->getLocalMatrix()); | 57 total.setConcat(matrix, this->getLocalMatrix()); |
58 m = &total; | 58 m = &total; |
59 } | 59 } |
60 if (m->invert(&fTotalInverse)) { | 60 if (m->invert(&fTotalInverse)) { |
61 fTotalInverseClass = (uint8_t)ComputeMatrixClass(fTotalInverse); | 61 fTotalInverseClass = (uint8_t)ComputeMatrixClass(fTotalInverse); |
62 SkDEBUGCODE(fInSetContext = true;) | 62 SkDEBUGCODE(fInSetContext = true;) |
63 return true; | 63 return true; |
64 } | 64 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 #ifdef SK_DEVELOPER | 353 #ifdef SK_DEVELOPER |
354 void SkEmptyShader::toString(SkString* str) const { | 354 void SkEmptyShader::toString(SkString* str) const { |
355 str->append("SkEmptyShader: ("); | 355 str->append("SkEmptyShader: ("); |
356 | 356 |
357 this->INHERITED::toString(str); | 357 this->INHERITED::toString(str); |
358 | 358 |
359 str->append(")"); | 359 str->append(")"); |
360 } | 360 } |
361 #endif | 361 #endif |
OLD | NEW |