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

Side by Side Diff: gm/lcdtext.cpp

Issue 1834673002: Don't force lcd on non-opaque portion of layer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 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 8
9 /* Tests text rendering with LCD and subpixel rendering turned on and off. 9 /* Tests text rendering with LCD and subpixel rendering turned on and off.
10 */ 10 */
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 paint.setTextSize(20); 138 paint.setTextSize(20);
139 139
140 canvas->drawText("Hamburgefons", 12, 30, 30, paint); 140 canvas->drawText("Hamburgefons", 12, 30, 30, paint);
141 141
142 const bool gPreserveLCDText[] = { false, true }; 142 const bool gPreserveLCDText[] = { false, true };
143 143
144 canvas->translate(0, 20); 144 canvas->translate(0, 20);
145 for (auto preserve : gPreserveLCDText) { 145 for (auto preserve : gPreserveLCDText) {
146 preserve ? canvas->saveLayerPreserveLCDTextRequests(nullptr, nullptr) 146 preserve ? canvas->saveLayerPreserveLCDTextRequests(nullptr, nullptr)
147 : canvas->saveLayer(nullptr, nullptr); 147 : canvas->saveLayer(nullptr, nullptr);
148 canvas->drawText("Hamburgefons", 12, 30, 60, paint); 148 if (preserve) {
149 SkPaint noLCD = paint;
150 noLCD.setLCDRenderText(false);
151 canvas->drawText("LCD not supported", 17, 30, 60, noLCD);
152 } else {
153 canvas->drawText("Hamburgefons", 12, 30, 60, paint);
154 }
149 155
150 SkPaint p; 156 SkPaint p;
151 p.setColor(0xFFCCCCCC); 157 p.setColor(0xFFCCCCCC);
152 canvas->drawRect(SkRect::MakeLTRB(25, 70, 200, 100), p); 158 canvas->drawRect(SkRect::MakeLTRB(25, 70, 200, 100), p);
153 canvas->drawText("Hamburgefons", 12, 30, 90, paint); 159 canvas->drawText("Hamburgefons", 12, 30, 90, paint);
154 160
155 canvas->restore(); 161 canvas->restore();
156 canvas->translate(0, 80); 162 canvas->translate(0, 80);
157 } 163 }
158 } 164 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698