OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkMeshUtils.h" | 8 #include "SkMeshUtils.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 const SkColor colors[], const SkPaint& paint) { | 90 const SkColor colors[], const SkPaint& paint) { |
91 SkMeshIndices idx; | 91 SkMeshIndices idx; |
92 | 92 |
93 if (idx.init(bitmap.width(), bitmap.height(), rows, cols)) { | 93 if (idx.init(bitmap.width(), bitmap.height(), rows, cols)) { |
94 SkPaint p(paint); | 94 SkPaint p(paint); |
95 p.setShader(SkShader::CreateBitmapShader(bitmap, | 95 p.setShader(SkShader::CreateBitmapShader(bitmap, |
96 SkShader::kClamp_TileMode, | 96 SkShader::kClamp_TileMode, |
97 SkShader::kClamp_TileMode))->unref(); | 97 SkShader::kClamp_TileMode))->unref(); |
98 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, | 98 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, |
99 rows * cols, verts, idx.tex(), colors, NULL, | 99 rows * cols, verts, idx.tex(), colors, NULL, |
100 idx.indices(), idx.indexCount(), p); | 100 idx.indices(), int(idx.indexCount()), p); |
101 } | 101 } |
102 } | 102 } |
OLD | NEW |