OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkDrawShader.h" | 10 #include "SkDrawShader.h" |
11 #include "SkDrawBitmap.h" | 11 #include "SkDrawBitmap.h" |
12 #include "SkDrawMatrix.h" | 12 #include "SkDrawMatrix.h" |
13 #include "SkDrawPaint.h" | 13 #include "SkDrawPaint.h" |
14 #include "SkTemplates.h" | |
15 | 14 |
16 #if SK_USE_CONDENSED_INFO == 0 | 15 #if SK_USE_CONDENSED_INFO == 0 |
17 | 16 |
18 const SkMemberInfo SkDrawShader::fInfo[] = { | 17 const SkMemberInfo SkDrawShader::fInfo[] = { |
19 SK_MEMBER(matrix, Matrix), | 18 SK_MEMBER(matrix, Matrix), |
20 SK_MEMBER(tileMode, TileMode) | 19 SK_MEMBER(tileMode, TileMode) |
21 }; | 20 }; |
22 | 21 |
23 #endif | 22 #endif |
24 | 23 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 SkShader* SkDrawBitmapShader::getShader() { | 64 SkShader* SkDrawBitmapShader::getShader() { |
66 if (image == NULL) | 65 if (image == NULL) |
67 return NULL; | 66 return NULL; |
68 | 67 |
69 // note: bitmap shader now supports independent tile modes for X and Y | 68 // note: bitmap shader now supports independent tile modes for X and Y |
70 // we pass the same to both, but later we should extend this flexibility | 69 // we pass the same to both, but later we should extend this flexibility |
71 // to the xml (e.g. tileModeX="repeat" tileModeY="clmap") | 70 // to the xml (e.g. tileModeX="repeat" tileModeY="clmap") |
72 // | 71 // |
73 // oops, bitmapshader no longer takes filterBitmap, but deduces it at | 72 // oops, bitmapshader no longer takes filterBitmap, but deduces it at |
74 // draw-time from the paint | 73 // draw-time from the paint |
75 SkShader* shader = SkShader::CreateBitmapShader(image->fBitmap, | 74 return SkShader::CreateBitmapShader(image->fBitmap, |
76 (SkShader::TileMode) tileMod
e, | 75 (SkShader::TileMode) tileMode, |
77 (SkShader::TileMode) tileMod
e, | 76 (SkShader::TileMode) tileMode, |
78 getMatrix()); | 77 getMatrix()); |
79 SkAutoTDelete<SkShader> autoDel(shader); | |
80 (void)autoDel.detach(); | |
81 return shader; | |
82 } | 78 } |
OLD | NEW |