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

Unified Diff: samplecode/SampleMeasure.cpp

Issue 510433002: remove (unused) scale parameter from measureText (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused field from struct Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleMeasure.cpp
diff --git a/samplecode/SampleMeasure.cpp b/samplecode/SampleMeasure.cpp
index 257f7d99e0ba9800afb047056eb94f5418ce2422..86f9b52516adfd49aaa7a11ac7560c66e065c68d 100644
--- a/samplecode/SampleMeasure.cpp
+++ b/samplecode/SampleMeasure.cpp
@@ -23,22 +23,15 @@
// exercise scale/linear/devkern
struct Setting {
- SkScalar fScale;
bool fLinearText;
bool fDevKernText;
};
-static const SkScalar ONE = SkIntToScalar(9999)/10000;
-
static const Setting gSettings[] = {
- { 0, false, false },
- { 0, false, true },
- { 0, true, false },
- { 0, true, true },
- { ONE, false, false },
- { ONE, false, true },
- { ONE, true, false },
- { ONE, true, true }
+ { false, false },
+ { false, true },
+ { true, false },
+ { true, true },
};
static void doMeasure(SkCanvas* canvas, const SkPaint& paint, const char text[]) {
@@ -55,10 +48,9 @@ static void doMeasure(SkCanvas* canvas, const SkPaint& paint, const char text[])
for (size_t i = 0; i < SK_ARRAY_COUNT(gSettings); i++) {
p.setLinearText(gSettings[i].fLinearText);
p.setDevKernText(gSettings[i].fDevKernText);
- SkScalar scale = gSettings[i].fScale;
int n = p.getTextWidths(text, len, widths, rects);
- SkScalar w = p.measureText(text, len, &bounds, scale);
+ SkScalar w = p.measureText(text, len, &bounds);
p.setStyle(SkPaint::kFill_Style);
p.setColor(0x8888FF88);
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698