make imagefilters* imagemagnifier imageresizetiled portable
authorcaryclark <caryclark@google.com>
Thu, 16 Jul 2015 19:35:58 +0000 (12:35 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 16 Jul 2015 19:35:58 +0000 (12:35 -0700)
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1238083004

gm/imagefiltersbase.cpp
gm/imagefiltersgraph.cpp
gm/imagemagnifier.cpp
gm/imageresizetiled.cpp

index 6e8ac29dea0b3ae1d98b20065a9c2b6b12ad922b..993e65413f5a9acdf9f329a6bf8bb5a46a160bd0 100644 (file)
@@ -145,7 +145,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
     paint.setImageFilter(imf);
     paint.setColor(SK_ColorCYAN);
     paint.setAntiAlias(true);
-    sk_tool_utils::set_portable_typeface(&paint);
+    sk_tool_utils::set_portable_typeface_always(&paint);
     paint.setTextSize(r.height()/2);
     paint.setTextAlign(SkPaint::kCenter_Align);
     canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
@@ -283,6 +283,7 @@ protected:
             SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag,
         };
         SkPaint paint(origPaint);
+        sk_tool_utils::set_portable_typeface_always(&paint);
         paint.setTextSize(30);
 
         SkAutoCanvasRestore acr(canvas, true);
index cfedaf0256dd5d552f19cf611e1d5ddb7708146e..fb3d79fef307f2424e794c4018656f8bc1ca7e65 100644 (file)
@@ -113,7 +113,7 @@ protected:
         canvas.clear(SK_ColorTRANSPARENT);
         SkPaint paint;
         paint.setAntiAlias(true);
-        sk_tool_utils::set_portable_typeface(&paint);
+        sk_tool_utils::set_portable_typeface_always(&paint);
         paint.setColor(SK_ColorWHITE);
         paint.setTextSize(SkIntToScalar(96));
         const char* str = "e";
index 5e4835033a548fab729f3dab2c30b7f767ad544a..2e739cf38e3116c4616f2a18903128d315fbddbc 100644 (file)
@@ -45,8 +45,8 @@ protected:
             int x = rand.nextULessThan(WIDTH);
             int y = rand.nextULessThan(HEIGHT);
             SkPaint paint;
-            sk_tool_utils::set_portable_typeface(&paint);
-            paint.setColor(rand.nextBits(24) | 0xFF000000);
+            sk_tool_utils::set_portable_typeface_always(&paint);
+            paint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
             paint.setTextSize(rand.nextRangeScalar(0, 300));
             paint.setAntiAlias(true);
             canvas->drawText(str, strlen(str), SkIntToScalar(x),
index bc640bc6aa5b4e1ab613943faa8b1b25dad4151e..724f95044655bf83b417e77b95ef84a0c437c777 100644 (file)
@@ -56,7 +56,7 @@ protected:
                 };
                 SkPaint textPaint;
                 textPaint.setAntiAlias(true);
-                sk_tool_utils::set_portable_typeface(&textPaint);
+                sk_tool_utils::set_portable_typeface_always(&textPaint);
                 textPaint.setTextSize(SkIntToScalar(100));
                 int posY = 0;
                 for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {