aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-20 10:48:01 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-20 10:48:01 -0700
commit85693c15c8948911afb0036a1a01bda64157a0ab (patch)
treee8cf5b1f334b8579f5b1a8e53bae5ce39c4aeede
parent942930dcaa51f66d82cdaf46ae62efebd16c8cd0 (diff)
make stroketext textblob* texteffects tileimagefilter gm portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1244833002
-rw-r--r--gm/stroketext.cpp2
-rw-r--r--gm/textblobcolortrans.cpp7
-rw-r--r--gm/textblobgeometrychange.cpp2
-rw-r--r--gm/textblobtransforms.cpp6
-rw-r--r--gm/textblobuseaftergpufree.cpp3
-rw-r--r--gm/texteffects.cpp2
-rw-r--r--gm/tileimagefilter.cpp6
7 files changed, 16 insertions, 12 deletions
diff --git a/gm/stroketext.cpp b/gm/stroketext.cpp
index 6ec425b5b2..b6c7b1ef6b 100644
--- a/gm/stroketext.cpp
+++ b/gm/stroketext.cpp
@@ -84,7 +84,7 @@ protected:
if (true) { test_nulldev(canvas); }
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(kBelowThreshold_TextSize);
draw_text_set(canvas, paint);
diff --git a/gm/textblobcolortrans.cpp b/gm/textblobcolortrans.cpp
index cb4686e6e7..b6776813b1 100644
--- a/gm/textblobcolortrans.cpp
+++ b/gm/textblobcolortrans.cpp
@@ -31,7 +31,7 @@ protected:
SkPaint paint;
paint.setTextSize(256);
const char* text = "AB";
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
@@ -61,7 +61,7 @@ protected:
void onDraw(SkCanvas* canvas) override {
- canvas->drawColor(SK_ColorGRAY);
+ canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
SkPaint paint;
canvas->translate(10, 40);
@@ -71,7 +71,8 @@ protected:
// Colors were chosen to map to pairs of canonical colors. The GPU Backend will cache A8
// Texture Blobs based on the canonical color they map to. Canonical colors are used to
// create masks. For A8 there are 8 of them.
- SkColor colors[] = {SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorYELLOW, SK_ColorWHITE};
+ SkColor colors[] = {SK_ColorCYAN, sk_tool_utils::color_to_565(SK_ColorLTGRAY),
+ SK_ColorYELLOW, SK_ColorWHITE};
size_t count = SK_ARRAY_COUNT(colors);
size_t colorIndex = 0;
diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp
index fec1ac050d..fa48ee09bc 100644
--- a/gm/textblobgeometrychange.cpp
+++ b/gm/textblobgeometrychange.cpp
@@ -31,7 +31,7 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(20);
paint.setAntiAlias(true);
paint.setLCDRenderText(true);
diff --git a/gm/textblobtransforms.cpp b/gm/textblobtransforms.cpp
index d24e6e860e..76342e593f 100644
--- a/gm/textblobtransforms.cpp
+++ b/gm/textblobtransforms.cpp
@@ -28,7 +28,7 @@ protected:
SkPaint paint;
paint.setTextSize(162);
const char* text = "A";
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
@@ -62,7 +62,7 @@ protected:
void onDraw(SkCanvas* canvas) override {
- canvas->drawColor(SK_ColorGRAY);
+ canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
SkPaint paint;
@@ -72,7 +72,7 @@ protected:
// Colors were chosen to map to pairs of canonical colors. The GPU Backend will cache A8
// Texture Blobs based on the canonical color they map to. Canonical colors are used to
// create masks. For A8 there are 8 of them.
- //SkColor colors[] = {SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorYELLOW, SK_ColorWHITE};
+ //SkColor colors[] = {SK_ColorCYAN, sk_tool_utils::color_to_565(SK_ColorLTGRAY), SK_ColorYELLOW, SK_ColorWHITE};
SkScalar xOffset = SkScalarCeilToScalar(bounds.width());
SkScalar yOffset = SkScalarCeilToScalar(bounds.height());
diff --git a/gm/textblobuseaftergpufree.cpp b/gm/textblobuseaftergpufree.cpp
index 070c9ef155..b949fadf1c 100644
--- a/gm/textblobuseaftergpufree.cpp
+++ b/gm/textblobuseaftergpufree.cpp
@@ -39,7 +39,8 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
+ paint.setAntiAlias(true);
paint.setTextSize(20);
SkTextBlobBuilder builder;
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index 03dbd68cc1..af4b12e1a6 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -188,7 +188,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(56));
SkScalar x = SkIntToScalar(20);
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index 82393087b0..5cf8ab1281 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -23,7 +23,7 @@ static SkBitmap make_bitmap() {
canvas.clear(0xFF000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setColor(0xD000D000);
paint.setTextSize(SkIntToScalar(50));
const char* str = "e";
@@ -54,7 +54,9 @@ protected:
fCheckerboard.allocN32Pixels(80, 80);
SkCanvas checkerboardCanvas(fCheckerboard);
- sk_tool_utils::draw_checkerboard(&checkerboardCanvas, 0xFFA0A0A0, 0xFF404040, 8);
+ sk_tool_utils::draw_checkerboard(&checkerboardCanvas,
+ sk_tool_utils::color_to_565(0xFFA0A0A0),
+ sk_tool_utils::color_to_565(0xFF404040), 8);
}
void onDraw(SkCanvas* canvas) override {