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

Unified Diff: gm/tilemodes.cpp

Issue 1236893002: make gm text and colors portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « gm/poly2poly.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tilemodes.cpp
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 391d969c08114dbb53b93e5451fa314dcb146b5e..5ff84c8db61c9f36abfefbca252d71a3eb6d405a 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -10,9 +10,7 @@
#include "SkRegion.h"
#include "SkShader.h"
#include "SkUtils.h"
-#include "SkColorPriv.h"
#include "SkColorFilter.h"
-#include "SkTypeface.h"
// effects
#include "SkGradientShader.h"
@@ -100,7 +98,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
p.setDither(true);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
@@ -140,7 +138,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p);
}
@@ -168,7 +166,7 @@ static SkShader* make_grad(SkShader::TileMode tx, SkShader::TileMode ty) {
SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(gWidth), SkIntToScalar(gHeight)} };
SkPoint center = { SkIntToScalar(gWidth)/2, SkIntToScalar(gHeight)/2 };
SkScalar rad = SkIntToScalar(gWidth)/2;
- SkColor colors[] = { 0xFFFF0000, 0xFF0044FF };
+ SkColor colors[] = { 0xFFFF0000, sk_tool_utils::color_to_565(0xFF0044FF) };
int index = (int)ty;
switch (index % 3) {
@@ -220,7 +218,7 @@ protected:
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
« no previous file with comments | « gm/poly2poly.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698