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

Side by Side Diff: gm/textblobmixedsizes.cpp

Issue 1760163002: Avoid drawing NVPR DIF text when text size is 0 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comment 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 | src/gpu/gl/GrGLPath.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 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); 67 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset);
68 68
69 // micro (will fall out of distance field text even if distance field te xt is enabled) 69 // micro (will fall out of distance field text even if distance field te xt is enabled)
70 paint.measureText(text, strlen(text), &bounds); 70 paint.measureText(text, strlen(text), &bounds);
71 yOffset += bounds.height(); 71 yOffset += bounds.height();
72 paint.setTextSize(14); 72 paint.setTextSize(14);
73 73
74 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset); 74 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset);
75 75
76 // Zero size.
77 paint.measureText(text, strlen(text), &bounds);
78 yOffset += bounds.height();
79 paint.setTextSize(0);
80
81 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, yOffset);
82
76 // build 83 // build
77 fBlob.reset(builder.build()); 84 fBlob.reset(builder.build());
78 } 85 }
79 86
80 SkString onShortName() override { 87 SkString onShortName() override {
81 SkString name("textblobmixedsizes"); 88 SkString name("textblobmixedsizes");
82 if (fUseDFT) { 89 if (fUseDFT) {
83 name.appendf("_df"); 90 name.appendf("_df");
84 } 91 }
85 return name; 92 return name;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 typedef GM INHERITED; 189 typedef GM INHERITED;
183 }; 190 };
184 191
185 ////////////////////////////////////////////////////////////////////////////// 192 //////////////////////////////////////////////////////////////////////////////
186 193
187 DEF_GM( return new TextBlobMixedSizes(false); ) 194 DEF_GM( return new TextBlobMixedSizes(false); )
188 #if SK_SUPPORT_GPU 195 #if SK_SUPPORT_GPU
189 DEF_GM( return new TextBlobMixedSizes(true); ) 196 DEF_GM( return new TextBlobMixedSizes(true); )
190 #endif 197 #endif
191 } 198 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698