Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: gm/lcdoverlap.cpp

Issue 2335493005: Use sk_sp text blob APIs (Closed)
Patch Set: SK_SUPPORT_LEGACY_TEXTBLOB_BUILDER Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/largeglyphblur.cpp ('k') | gm/mixedtextblobs.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « gm/largeglyphblur.cpp ('k') | gm/mixedtextblobs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698