OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 8 |
9 /* | 9 /* |
10 * Tests overlapping LCD text | 10 * Tests overlapping LCD text |
(...skipping 26 matching lines...) Expand all Loading... |
37 SkTextBlobBuilder builder; | 37 SkTextBlobBuilder builder; |
38 | 38 |
39 SkPaint paint; | 39 SkPaint paint; |
40 sk_tool_utils::set_portable_typeface(&paint); | 40 sk_tool_utils::set_portable_typeface(&paint); |
41 paint.setTextSize(32); | 41 paint.setTextSize(32); |
42 const char* text = "able was I ere I saw elba"; | 42 const char* text = "able was I ere I saw elba"; |
43 paint.setAntiAlias(true); | 43 paint.setAntiAlias(true); |
44 paint.setSubpixelText(true); | 44 paint.setSubpixelText(true); |
45 paint.setLCDRenderText(true); | 45 paint.setLCDRenderText(true); |
46 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0); | 46 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0); |
47 fBlob.reset(builder.build()); | 47 fBlob = builder.make(); |
48 } | 48 } |
49 | 49 |
50 SkISize onISize() override { return SkISize::Make(kWidth, kHeight); } | 50 SkISize onISize() override { return SkISize::Make(kWidth, kHeight); } |
51 | 51 |
52 void drawTestCase(SkCanvas* canvas, SkScalar x, SkScalar y, SkXfermode::Mode
mode, | 52 void drawTestCase(SkCanvas* canvas, SkScalar x, SkScalar y, SkXfermode::Mode
mode, |
53 SkXfermode::Mode mode2) { | 53 SkXfermode::Mode mode2) { |
54 const SkColor colors[] { | 54 const SkColor colors[] { |
55 SK_ColorRED, | 55 SK_ColorRED, |
56 SK_ColorGREEN, | 56 SK_ColorGREEN, |
57 SK_ColorBLUE, | 57 SK_ColorBLUE, |
(...skipping 25 matching lines...) Expand all Loading... |
83 drawTestCase(canvas, 3 * offsetX, offsetY, SkXfermode::kSrcOver_Mode, | 83 drawTestCase(canvas, 3 * offsetX, offsetY, SkXfermode::kSrcOver_Mode, |
84 SkXfermode::kSrcOver_Mode); | 84 SkXfermode::kSrcOver_Mode); |
85 drawTestCase(canvas, offsetX, 3 * offsetY, SkXfermode::kHardLight_Mode, | 85 drawTestCase(canvas, offsetX, 3 * offsetY, SkXfermode::kHardLight_Mode, |
86 SkXfermode::kLuminosity_Mode); | 86 SkXfermode::kLuminosity_Mode); |
87 drawTestCase(canvas, 3 * offsetX, 3 * offsetY, SkXfermode::kSrcOver_Mod
e, | 87 drawTestCase(canvas, 3 * offsetX, 3 * offsetY, SkXfermode::kSrcOver_Mod
e, |
88 SkXfermode::kSrc_Mode); | 88 SkXfermode::kSrc_Mode); |
89 } | 89 } |
90 | 90 |
91 private: | 91 private: |
92 SkScalar fTextHeight; | 92 SkScalar fTextHeight; |
93 SkAutoTUnref<const SkTextBlob> fBlob; | 93 sk_sp<SkTextBlob> fBlob; |
94 typedef skiagm::GM INHERITED; | 94 typedef skiagm::GM INHERITED; |
95 }; | 95 }; |
96 | 96 |
97 ////////////////////////////////////////////////////////////////////////////// | 97 ////////////////////////////////////////////////////////////////////////////// |
98 | 98 |
99 DEF_GM( return new LcdOverlapGM; ) | 99 DEF_GM( return new LcdOverlapGM; ) |
100 } | 100 } |
OLD | NEW |