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

Unified Diff: samplecode/SampleShip.cpp

Issue 1410663005: Add text animation sample; tweak DrawShip sample (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Correct fix for CrOS Created 5 years, 1 month 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 | « samplecode/SampleApp.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleShip.cpp
diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp
index caaad046d91824eaf4c129dff115316558fd22c4..fddf0235baf7836de550e0f313b70f155427f100 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -70,7 +70,7 @@ public:
fTex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f,
SkIntToScalar(fAtlas->width()),
SkIntToScalar(fAtlas->height()));
- fXform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f,
+ fXform[currIndex] = SkRSXform::MakeFromRadians(0.1f, SK_ScalarPI*0.5f,
xPos, yPos, anchorX, anchorY);
currIndex++;
}
@@ -78,7 +78,7 @@ public:
fTex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f,
SkIntToScalar(fAtlas->width()),
SkIntToScalar(fAtlas->height()));
- fXform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f,
+ fXform[currIndex] = SkRSXform::MakeFromRadians(0.5f, SK_ScalarPI*0.5f,
kWidth*0.5f, kHeight*0.5f, anchorX, anchorY);
fCurrentTime = 0;
@@ -147,7 +147,10 @@ protected:
}
fProc(canvas, fAtlas, fXform, fTex, nullptr, kGrid*kGrid+1, nullptr, &paint);
- canvas->drawText(outString.c_str(), outString.size(), 100.f, 100.f, paint);
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawRect(SkRect::MakeXYWH(0, 0, 200, 24), paint);
+ paint.setColor(SK_ColorWHITE);
+ canvas->drawText(outString.c_str(), outString.size(), 5, 15, paint);
this->inval(nullptr);
}
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698