Revert of Revert of make gm background colors 565 compatible (patchset #1 id:1 of https://codereview.chromium.org/1184123002/)
Reason for revert:
underlying problem with portable refs deleted more than once fixed
Original issue's description:
> Revert of make gm background colors 565 compatible (patchset #2 id:20001 of https://codereview.chromium.org/1176243006/)
>
> Reason for revert:
> breaks many bots with refcnt error
>
> Original issue's description:
> > make gm background colors 565 compatible
> >
> > Change a batch of GM tests to convert their background color
> > so that it is representable in 8888 and 565.
> >
> > Enable portable text in those same tests to minimize platform
> > differences.
> >
> > In a couple of bitmap tests, use portable typefaces instead of
> > choosing 'Times' which may or may not be available on the platform.
> >
> > R=borenet@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/be7f768a357aefb39c42d24b81b24d647bb6ab70
>
> TBR=borenet@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/0bdb08b1ba8fbd18c4838f86a23f1ef4b3a3bfdf
TBR=borenet@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1182403003
diff --git a/gm/anisotropic.cpp b/gm/anisotropic.cpp
index a004d75..c1f5190 100644
--- a/gm/anisotropic.cpp
+++ b/gm/anisotropic.cpp
@@ -13,7 +13,7 @@
class AnisotropicGM : public GM {
public:
AnisotropicGM() : fFilterQuality(kHigh_SkFilterQuality) {
- this->setBGColor(0xFFCCCCCC);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC));
}
protected:
diff --git a/gm/arcofzorro.cpp b/gm/arcofzorro.cpp
index ef2a36b..6efea27 100644
--- a/gm/arcofzorro.cpp
+++ b/gm/arcofzorro.cpp
@@ -16,7 +16,7 @@
class ArcOfZorroGM : public GM {
public:
ArcOfZorroGM() {
- this->setBGColor(0xFFCCCCCC);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC));
}
protected:
diff --git a/gm/bigblurs.cpp b/gm/bigblurs.cpp
index 2f1011b..a92c7fe 100644
--- a/gm/bigblurs.cpp
+++ b/gm/bigblurs.cpp
@@ -19,7 +19,7 @@
class BigBlursGM : public GM {
public:
BigBlursGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/bigmatrix.cpp b/gm/bigmatrix.cpp
index 32e637b..abe0f4e 100644
--- a/gm/bigmatrix.cpp
+++ b/gm/bigmatrix.cpp
@@ -15,7 +15,7 @@
class BigMatrixGM : public GM {
public:
BigMatrixGM() {
- this->setBGColor(0xFF66AA99);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFF66AA99));
}
protected:
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp
index 32e91e3..e1268b7 100644
--- a/gm/bitmapcopy.cpp
+++ b/gm/bitmapcopy.cpp
@@ -48,7 +48,7 @@
SkBitmap fDst[NUM_CONFIGS];
BitmapCopyGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -75,9 +75,9 @@
src.copyTo(&fDst[i], gColorTypes[i]);
}
- canvas->clear(0xFFDDDDDD);
+ canvas->clear(sk_tool_utils::color_to_565(0xFFDDDDDD));
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
SkScalar width = SkIntToScalar(40);
SkScalar height = SkIntToScalar(40);
diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp
index 22a297d..11f93c9 100644
--- a/gm/bitmapfilters.cpp
+++ b/gm/bitmapfilters.cpp
@@ -53,7 +53,7 @@
const int scale = 32;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
const char* name = sk_tool_utils::colortype_name(bm.colorType());
canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8,
paint);
@@ -80,7 +80,7 @@
SkBitmap fBM8, fBM4444, fBM16, fBM32;
FilterGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index 3fae2b3..e7b66d5 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -12,7 +12,7 @@
class BlursGM : public skiagm::GM {
public:
BlursGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/bmpfilterqualityrepeat.cpp b/gm/bmpfilterqualityrepeat.cpp
index 1097141..edcd696 100644
--- a/gm/bmpfilterqualityrepeat.cpp
+++ b/gm/bmpfilterqualityrepeat.cpp
@@ -14,7 +14,7 @@
// the bmp filter respects the repeat mode at the tile seams.
class BmpFilterQualityRepeat : public skiagm::GM {
public:
- BmpFilterQualityRepeat() { this->setBGColor(0xFFCCBBAA); }
+ BmpFilterQualityRepeat() { this->setBGColor(sk_tool_utils::color_to_565(0xFFCCBBAA)); }
protected:
@@ -51,6 +51,7 @@
for (size_t q = 0; q < SK_ARRAY_COUNT(kQualities); ++q) {
SkPaint paint;
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setFilterQuality(kQualities[q].fQuality);
SkPaint bmpPaint(paint);
SkMatrix lm = SkMatrix::I();
diff --git a/gm/clipdrawdraw.cpp b/gm/clipdrawdraw.cpp
index 11561b2..9659201 100644
--- a/gm/clipdrawdraw.cpp
+++ b/gm/clipdrawdraw.cpp
@@ -20,7 +20,7 @@
// can leave 1 pixel wide remnants of the first rect.
class ClipDrawDrawGM : public GM {
public:
- ClipDrawDrawGM() { this->setBGColor(0xFFCCCCCC); }
+ ClipDrawDrawGM() { this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC)); }
protected:
SkString onShortName() override { return SkString("clipdrawdraw"); }
diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp
index 36cf8c5..8dcdf15 100644
--- a/gm/colormatrix.cpp
+++ b/gm/colormatrix.cpp
@@ -49,7 +49,7 @@
public:
ColorMatrixGM() {
- this->setBGColor(0xFF808080);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFF808080));
}
protected:
diff --git a/gm/complexclip3.cpp b/gm/complexclip3.cpp
index afabcf6..7c22d71 100644
--- a/gm/complexclip3.cpp
+++ b/gm/complexclip3.cpp
@@ -17,7 +17,7 @@
public:
ComplexClip3GM(bool doSimpleClipFirst)
: fDoSimpleClipFirst(doSimpleClipFirst) {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -49,7 +49,7 @@
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(20));
static const struct {
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index 159bf06..cea7986 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -25,7 +25,7 @@
class ConstColorProcessor : public GM {
public:
ConstColorProcessor() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -124,6 +124,7 @@
// Draw labels for the input to the processor and the processor to the right of
// the test rect. The input label appears above the processor label.
SkPaint labelPaint;
+ sk_tool_utils::set_portable_typeface_always(&labelPaint);
labelPaint.setAntiAlias(true);
labelPaint.setTextSize(10.f);
SkString inputLabel;
diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp
index 6cfd00e..a456c0c 100644
--- a/gm/dcshader.cpp
+++ b/gm/dcshader.cpp
@@ -110,7 +110,7 @@
class DCShaderGM : public GM {
public:
DCShaderGM() {
- this->setBGColor(0xFFAABBCC);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFAABBCC));
}
~DCShaderGM() override {
@@ -210,7 +210,7 @@
}
virtual void setFont(SkPaint* paint) {
- sk_tool_utils::set_portable_typeface(paint);
+ sk_tool_utils::set_portable_typeface_always(paint);
}
virtual const char* text() const { return "Hello, Skia!"; }
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index 8decc69..bb47368 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -31,7 +31,7 @@
}
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface(paint, name, style);
+ sk_tool_utils::set_portable_typeface_always(paint, name, style);
}
class DownsampleBitmapGM : public skiagm::GM {
@@ -44,7 +44,7 @@
DownsampleBitmapGM(SkFilterQuality filterQuality)
: fFilterQuality(filterQuality)
{
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
fBitmapMade = false;
}
@@ -126,13 +126,13 @@
paint.setSubpixelText(true);
paint.setTextSize(fTextSize);
- setTypeface(&paint, "Times", SkTypeface::kNormal);
+ setTypeface(&paint, "serif", SkTypeface::kNormal);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 1.2f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kBold);
+ setTypeface(&paint, "serif", SkTypeface::kBold);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 2.4f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kItalic);
+ setTypeface(&paint, "serif", SkTypeface::kItalic);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 3.6f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kBoldItalic);
+ setTypeface(&paint, "serif", SkTypeface::kBoldItalic);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 4.8f*fTextSize, paint);
}
private:
@@ -202,7 +202,7 @@
SkBitmap fBM;
ShowMipLevels() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
make_checker(&fBM, 512, 256);
}
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp
index 25c9843..74e7e91 100644
--- a/gm/drawlooper.cpp
+++ b/gm/drawlooper.cpp
@@ -19,7 +19,7 @@
class DrawLooperGM : public skiagm::GM {
public:
DrawLooperGM() : fLooper(NULL) {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
virtual ~DrawLooperGM() {
diff --git a/gm/emptypath.cpp b/gm/emptypath.cpp
index b3f8016..64eb286 100644
--- a/gm/emptypath.cpp
+++ b/gm/emptypath.cpp
@@ -92,7 +92,7 @@
SkColor color = rand.nextU();
color = 0xff000000 | color; // force solid
- sk_tool_utils::color_to_565(&color);
+ color = sk_tool_utils::color_to_565(color);
this->drawEmpty(canvas, color, rect,
gStyles[style].fStyle, gFills[fill].fFill);
diff --git a/gm/filltypes.cpp b/gm/filltypes.cpp
index 4ba3aeb..f01f9bd 100644
--- a/gm/filltypes.cpp
+++ b/gm/filltypes.cpp
@@ -13,7 +13,7 @@
SkPath fPath;
public:
FillTypeGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
void makePath() {
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index 7d7c40f..d7194c0 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -14,7 +14,7 @@
#include "SkTypeface.h"
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface(paint, name, style);
+ sk_tool_utils::set_portable_typeface_always(paint, name, style);
}
static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) {
@@ -66,7 +66,7 @@
FilterBitmapGM()
{
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -124,13 +124,13 @@
paint.setSubpixelText(true);
paint.setTextSize(fTextSize);
- setTypeface(&paint, "Times", SkTypeface::kNormal);
+ setTypeface(&paint, "serif", SkTypeface::kNormal);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 1.2f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kBold);
+ setTypeface(&paint, "serif", SkTypeface::kBold);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 2.4f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kItalic);
+ setTypeface(&paint, "serif", SkTypeface::kItalic);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 3.6f*fTextSize, paint);
- setTypeface(&paint, "Times", SkTypeface::kBoldItalic);
+ setTypeface(&paint, "serif", SkTypeface::kBoldItalic);
canvas.drawText("Hamburgefons", 12, fTextSize/2, 4.8f*fTextSize, paint);
}
private:
diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp
index 5ff398e..a4b65e0 100644
--- a/gm/filterfastbounds.cpp
+++ b/gm/filterfastbounds.cpp
@@ -150,7 +150,7 @@
class ImageFilterFastBoundGM : public GM {
public:
ImageFilterFastBoundGM() {
- this->setBGColor(0xFFCCCCCC);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC));
}
protected:
diff --git a/gm/filterindiabox.cpp b/gm/filterindiabox.cpp
index d2fc30b..b9f5a7a 100644
--- a/gm/filterindiabox.cpp
+++ b/gm/filterindiabox.cpp
@@ -62,7 +62,7 @@
SkString fName;
FilterIndiaBoxGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
FilterIndiaBoxGM(const char filename[]) : fFilename(filename) {
diff --git a/gm/gradientDirtyLaundry.cpp b/gm/gradientDirtyLaundry.cpp
index ed5ad51..2ba0963 100644
--- a/gm/gradientDirtyLaundry.cpp
+++ b/gm/gradientDirtyLaundry.cpp
@@ -66,7 +66,7 @@
class GradientsGM : public GM {
public:
GradientsGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/gradient_matrix.cpp b/gm/gradient_matrix.cpp
index 77a0247..10499ca 100644
--- a/gm/gradient_matrix.cpp
+++ b/gm/gradient_matrix.cpp
@@ -116,7 +116,7 @@
class GradientMatrixGM : public GM {
public:
GradientMatrixGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/gradients.cpp b/gm/gradients.cpp
index 4e6aba9..523a112 100644
--- a/gm/gradients.cpp
+++ b/gm/gradients.cpp
@@ -101,7 +101,7 @@
class GradientsGM : public GM {
public:
GradientsGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -156,7 +156,7 @@
class GradientsLocalPerspectiveGM : public GM {
public:
GradientsLocalPerspectiveGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/gradients_2pt_conical.cpp b/gm/gradients_2pt_conical.cpp
index c865d71..1e32426 100644
--- a/gm/gradients_2pt_conical.cpp
+++ b/gm/gradients_2pt_conical.cpp
@@ -306,7 +306,7 @@
class ConicalGradientsGM : public GM {
public:
ConicalGradientsGM(GradCaseType gradCaseType) {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName);
fGradCaseType = gradCaseType;
}
diff --git a/gm/gradients_no_texture.cpp b/gm/gradients_no_texture.cpp
index 391472a..e706ac6 100644
--- a/gm/gradients_no_texture.cpp
+++ b/gm/gradients_no_texture.cpp
@@ -81,7 +81,7 @@
class GradientsNoTextureGM : public GM {
public:
GradientsNoTextureGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/internal_links.cpp b/gm/internal_links.cpp
index 3ba3052..e422868 100644
--- a/gm/internal_links.cpp
+++ b/gm/internal_links.cpp
@@ -20,7 +20,7 @@
class InternalLinksGM : public GM {
public:
InternalLinksGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -61,7 +61,7 @@
canvas->drawRect(rect, paint);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(25));
paint.setColor(SK_ColorBLACK);
canvas->drawText(text, strlen(text), x, y, paint);
diff --git a/gm/modecolorfilters.cpp b/gm/modecolorfilters.cpp
index 96b31cb..4fea1f1 100644
--- a/gm/modecolorfilters.cpp
+++ b/gm/modecolorfilters.cpp
@@ -56,7 +56,7 @@
class ModeColorFilterGM : public GM {
public:
ModeColorFilterGM() {
- this->setBGColor(0xFF303030);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFF303030));
}
protected:
diff --git a/gm/nested.cpp b/gm/nested.cpp
index 518a864..9040ba6 100644
--- a/gm/nested.cpp
+++ b/gm/nested.cpp
@@ -15,7 +15,7 @@
class NestedGM : public GM {
public:
NestedGM(bool doAA, bool flipped) : fDoAA(doAA), fFlipped(flipped) {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/pathinterior.cpp b/gm/pathinterior.cpp
index f56681a..24fea68 100644
--- a/gm/pathinterior.cpp
+++ b/gm/pathinterior.cpp
@@ -21,7 +21,7 @@
class PathInteriorGM : public skiagm::GM {
public:
PathInteriorGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index be46929..d8d62c4 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -27,7 +27,7 @@
kEffect_Type,
};
RRectGM(Type type) : fType(type) {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
this->setUpRRects();
}
diff --git a/gm/shadertext.cpp b/gm/shadertext.cpp
index 6845fa1..599cff3 100644
--- a/gm/shadertext.cpp
+++ b/gm/shadertext.cpp
@@ -87,7 +87,7 @@
class ShaderTextGM : public GM {
public:
ShaderTextGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -144,7 +144,7 @@
SkPaint paint;
paint.setDither(true);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(pointSize));
canvas->save();
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index 92a0138..cd996b3 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -43,7 +43,7 @@
class ShaderText2GM : public GM {
public:
ShaderText2GM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -90,13 +90,13 @@
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&fillPaint);
+ sk_tool_utils::set_portable_typeface_always(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&outlinePaint);
+ sk_tool_utils::set_portable_typeface_always(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -112,7 +112,7 @@
SkPaint labelPaint;
labelPaint.setColor(0xff000000);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&labelPaint);
+ sk_tool_utils::set_portable_typeface_always(&labelPaint);
labelPaint.setTextSize(12.f);
canvas->translate(15.f, 15.f);
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp
index 49cdced..47dd29e 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -48,7 +48,7 @@
class ShaderText3GM : public GM {
public:
ShaderText3GM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected:
@@ -73,7 +73,7 @@
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&outlinePaint);
+ sk_tool_utils::set_portable_typeface_always(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -107,7 +107,7 @@
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&fillPaint);
+ sk_tool_utils::set_portable_typeface_always(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
fillPaint.setShader(shader);
diff --git a/gm/shadows.cpp b/gm/shadows.cpp
index adb34b6..5c0e1e1 100644
--- a/gm/shadows.cpp
+++ b/gm/shadows.cpp
@@ -30,7 +30,7 @@
protected:
void onOnceBeforeDraw() override {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
fCirclePath.addCircle(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(10) );
fRect.set(SkIntToScalar(10), SkIntToScalar(10),
SkIntToScalar(30), SkIntToScalar(30));
diff --git a/gm/simpleaaclip.cpp b/gm/simpleaaclip.cpp
index c232a25..c0aa515 100644
--- a/gm/simpleaaclip.cpp
+++ b/gm/simpleaaclip.cpp
@@ -64,7 +64,7 @@
fBasePath.addRoundRect(fBase, SkIntToScalar(5), SkIntToScalar(5));
fRectPath.addRoundRect(fRect, SkIntToScalar(5), SkIntToScalar(5));
- INHERITED::setBGColor(0xFFDDDDDD);
+ INHERITED::setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
void buildRgn(SkAAClip* clip, SkRegion::Op op) {
@@ -156,7 +156,7 @@
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&textPaint);
+ sk_tool_utils::set_portable_typeface_always(&textPaint);
textPaint.setTextSize(SK_Scalar1*24);
int xOff = 0;
diff --git a/gm/tinybitmap.cpp b/gm/tinybitmap.cpp
index a188af9..9bfa228 100644
--- a/gm/tinybitmap.cpp
+++ b/gm/tinybitmap.cpp
@@ -32,7 +32,7 @@
class TinyBitmapGM : public GM {
public:
TinyBitmapGM() {
- this->setBGColor(0xFFDDDDDD);
+ this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
}
protected: