OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 for (int i = 0; i < count; ++i) { | 192 for (int i = 0; i < count; ++i) { |
193 SkPoint quad[4]; | 193 SkPoint quad[4]; |
194 xform[i].toQuad(tex[i].width(), tex[i].height(), quad); | 194 xform[i].toQuad(tex[i].width(), tex[i].height(), quad); |
195 | 195 |
196 SkMatrix localM; | 196 SkMatrix localM; |
197 localM.setRSXform(xform[i]); | 197 localM.setRSXform(xform[i]); |
198 localM.preTranslate(-tex[i].left(), -tex[i].top()); | 198 localM.preTranslate(-tex[i].left(), -tex[i].top()); |
199 | 199 |
200 SkPaint pnt(paint); | 200 SkPaint pnt(paint); |
201 SkAutoTUnref<SkShader> shader(atlas->newShader(SkShader::kClamp_TileMode
, | 201 sk_sp<SkShader> shader = atlas->makeShader(SkShader::kClamp_TileMode, |
202 SkShader::kClamp_TileMode
, | 202 SkShader::kClamp_TileMode, |
203 &localM)); | 203 &localM); |
204 if (!shader) { | 204 if (!shader) { |
205 break; | 205 break; |
206 } | 206 } |
207 pnt.setShader(shader); | 207 pnt.setShader(std::move(shader)); |
208 | 208 |
209 if (colors) { | 209 if (colors) { |
210 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color
s[i], mode)); | 210 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color
s[i], mode)); |
211 pnt.setColorFilter(cf); | 211 pnt.setColorFilter(cf); |
212 } | 212 } |
213 | 213 |
214 path.rewind(); | 214 path.rewind(); |
215 path.addPoly(quad, 4, true); | 215 path.addPoly(quad, 4, true); |
216 path.setConvexity(SkPath::kConvex_Convexity); | 216 path.setConvexity(SkPath::kConvex_Convexity); |
217 this->drawPath(draw, path, pnt, nullptr, true); | 217 this->drawPath(draw, path, pnt, nullptr, true); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() | 446 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() |
447 || this->onShouldDisableLCD(paint)) { | 447 || this->onShouldDisableLCD(paint)) { |
448 | 448 |
449 flags &= ~SkPaint::kLCDRenderText_Flag; | 449 flags &= ~SkPaint::kLCDRenderText_Flag; |
450 flags |= SkPaint::kGenA8FromLCD_Flag; | 450 flags |= SkPaint::kGenA8FromLCD_Flag; |
451 } | 451 } |
452 | 452 |
453 return flags; | 453 return flags; |
454 } | 454 } |
455 | 455 |
OLD | NEW |