OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
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 "SkPictureShader.h" | 8 #include "SkPictureShader.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 fLocalMatrixStorage[i] = localMatrix[i]; | 40 fLocalMatrixStorage[i] = localMatrix[i]; |
41 } | 41 } |
42 | 42 |
43 static const size_t keySize = sizeof(fPictureID) + | 43 static const size_t keySize = sizeof(fPictureID) + |
44 sizeof(fTile) + | 44 sizeof(fTile) + |
45 sizeof(fTmx) + sizeof(fTmy) + | 45 sizeof(fTmx) + sizeof(fTmy) + |
46 sizeof(fScale) + | 46 sizeof(fScale) + |
47 sizeof(fLocalMatrixStorage); | 47 sizeof(fLocalMatrixStorage); |
48 // This better be packed. | 48 // This better be packed. |
49 SkASSERT(sizeof(uint32_t) * (&fEndOfStruct - &fPictureID) == keySize); | 49 SkASSERT(sizeof(uint32_t) * (&fEndOfStruct - &fPictureID) == keySize); |
50 this->init(&gBitmapSkaderKeyNamespaceLabel, keySize); | 50 this->init(&gBitmapSkaderKeyNamespaceLabel, 0, keySize); |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
54 uint32_t fPictureID; | 54 uint32_t fPictureID; |
55 SkRect fTile; | 55 SkRect fTile; |
56 SkShader::TileMode fTmx, fTmy; | 56 SkShader::TileMode fTmx, fTmy; |
57 SkSize fScale; | 57 SkSize fScale; |
58 SkScalar fLocalMatrixStorage[9]; | 58 SkScalar fLocalMatrixStorage[9]; |
59 | 59 |
60 SkDEBUGCODE(uint32_t fEndOfStruct;) | 60 SkDEBUGCODE(uint32_t fEndOfStruct;) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, fp); | 303 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, fp); |
304 } | 304 } |
305 #else | 305 #else |
306 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, | 306 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, |
307 const SkMatrix*, GrColor*, | 307 const SkMatrix*, GrColor*, |
308 GrFragmentProcessor**) const { | 308 GrFragmentProcessor**) const { |
309 SkDEBUGFAIL("Should not call in GPU-less build"); | 309 SkDEBUGFAIL("Should not call in GPU-less build"); |
310 return false; | 310 return false; |
311 } | 311 } |
312 #endif | 312 #endif |
OLD | NEW |