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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
8 | 8 |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 | 2103 |
2104 // setup our state and function pointer for iterating triangles | 2104 // setup our state and function pointer for iterating triangles |
2105 VertState state(count, indices, indexCount); | 2105 VertState state(count, indices, indexCount); |
2106 VertState::Proc vertProc = state.chooseProc(vmode); | 2106 VertState::Proc vertProc = state.chooseProc(vmode); |
2107 | 2107 |
2108 if (textures || colors) { | 2108 if (textures || colors) { |
2109 while (vertProc(&state)) { | 2109 while (vertProc(&state)) { |
2110 if (textures) { | 2110 if (textures) { |
2111 SkMatrix tempM; | 2111 SkMatrix tempM; |
2112 if (texture_to_matrix(state, vertices, textures, &tempM)) { | 2112 if (texture_to_matrix(state, vertices, textures, &tempM)) { |
2113 SkShader::ContextRec rec(*fBitmap, p, *fMatrix); | 2113 SkShader::ContextRec rec(p, *fMatrix, &tempM); |
2114 rec.fLocalMatrix = &tempM; | |
2115 if (!blitter->resetShaderContext(rec)) { | 2114 if (!blitter->resetShaderContext(rec)) { |
2116 continue; | 2115 continue; |
2117 } | 2116 } |
2118 } | 2117 } |
2119 } | 2118 } |
2120 if (colors) { | 2119 if (colors) { |
2121 // Find the context for triShader. | 2120 // Find the context for triShader. |
2122 SkTriColorShader::TriColorShaderContext* triColorShaderContext; | 2121 SkTriColorShader::TriColorShaderContext* triColorShaderContext; |
2123 | 2122 |
2124 SkShader::Context* shaderContext = blitter->getShaderContext(); | 2123 SkShader::Context* shaderContext = blitter->getShaderContext(); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2275 mask->fImage = SkMask::AllocImage(size); | 2274 mask->fImage = SkMask::AllocImage(size); |
2276 memset(mask->fImage, 0, mask->computeImageSize()); | 2275 memset(mask->fImage, 0, mask->computeImageSize()); |
2277 } | 2276 } |
2278 | 2277 |
2279 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2278 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2280 draw_into_mask(*mask, devPath, style); | 2279 draw_into_mask(*mask, devPath, style); |
2281 } | 2280 } |
2282 | 2281 |
2283 return true; | 2282 return true; |
2284 } | 2283 } |
OLD | NEW |