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

Unified Diff: samplecode/SampleApp.cpp

Issue 2267623002: make zoomer text clearer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 62970302df50d53de5e5ae7a221b23278b8afdaf..9e7e651b1c6e91400e78fa1031fdf1f00cb49110 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -837,7 +837,9 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
fMouseX = fMouseY = 0;
fFatBitsScale = 8;
- fTypeface = SkTypeface::MakeFromTypeface(nullptr, SkTypeface::kBold);
+ fTypeface = SkTypeface::MakeFromName("Courier", SkFontStyle(SkFontStyle::kBold_Weight,
+ SkFontStyle::kNormal_Width,
+ SkFontStyle::kUpright_Slant));
fShowZoomer = false;
fZoomLevel = 0;
@@ -999,10 +1001,6 @@ static void drawText(SkCanvas* canvas, SkString str, SkScalar left, SkScalar top
SkScalar inset = SkIntToScalar(-2);
bounds.inset(inset, inset);
canvas->drawRect(bounds, paint);
- if (desiredColor != SK_ColorBLACK) {
- paint.setColor(SK_ColorBLACK);
- canvas->drawText(c_str, size, left + SK_Scalar1, top + SK_Scalar1, paint);
- }
paint.setColor(desiredColor);
canvas->drawText(c_str, size, left, top, paint);
}
@@ -1247,6 +1245,7 @@ void SampleWindow::showZoomer(SkCanvas* canvas) {
// Identify the pixel and its color on screen
paint.setTypeface(fTypeface);
paint.setAntiAlias(true);
+ paint.setTextSize(18);
SkScalar lineHeight = paint.getFontMetrics(nullptr);
SkString string;
string.appendf("(%i, %i)", fMouseX, fMouseY);
@@ -1268,7 +1267,7 @@ void SampleWindow::showZoomer(SkCanvas* canvas) {
i += SK_Scalar1;
string.reset();
string.appendf("G: %X", SkColorGetG(color));
- paint.setColor(SK_ColorGREEN);
+ paint.setColor(0xFF008800);
drawText(canvas, string, left, SkScalarMulAdd(lineHeight, i, dest.fTop), paint);
// Blue
i += SK_Scalar1;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698