aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-11-09 13:10:30 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-09 13:10:30 -0800
commitb2ce0b0735e08718bcba01b44519904ad9020f34 (patch)
treec5c0f8a52595eb623c72c319ca29181a6b3c7537 /samplecode
parent47fdae9807c559e8b9f6ddff26cd34de03441594 (diff)
demo tweaks, scale up perlin, add call to flush for fps
BUG=skia: TBR=bsalomon Review URL: https://codereview.chromium.org/1419983006
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/PerlinPatch.cpp25
-rwxr-xr-xsamplecode/SampleAnimatedText.cpp2
-rw-r--r--samplecode/SampleApp.cpp1
3 files changed, 15 insertions, 13 deletions
diff --git a/samplecode/PerlinPatch.cpp b/samplecode/PerlinPatch.cpp
index 945b6921fe..9bb95e5259 100644
--- a/samplecode/PerlinPatch.cpp
+++ b/samplecode/PerlinPatch.cpp
@@ -75,23 +75,24 @@ class PerlinPatchView : public SampleView {
public:
PerlinPatchView() : fXFreq(0.025f), fYFreq(0.025f), fSeed(0.0f),
fTexX(100.0), fTexY(50.0), fTexScale(1.0f) {
+ const SkScalar s = 2;
// The order of the colors and points is clockwise starting at upper-left corner.
//top points
- fPts[0].set(100, 100);
- fPts[1].set(150, 50);
- fPts[2].set(250, 150);
- fPts[3].set(300, 100);
+ fPts[0].set(100 * s, 100 * s);
+ fPts[1].set(150 * s, 50 * s);
+ fPts[2].set(250 * s, 150 * s);
+ fPts[3].set(300 * s, 100 * s);
//right points
- fPts[4].set(275, 150);
- fPts[5].set(350, 250);
+ fPts[4].set(275 * s, 150 * s);
+ fPts[5].set(350 * s, 250 * s);
//bottom points
- fPts[6].set(300, 300);
- fPts[7].set(250, 250);
+ fPts[6].set(300 * s, 300 * s);
+ fPts[7].set(250 * s, 250 * s);
//left points
- fPts[8].set(150, 350);
- fPts[9].set(100, 300);
- fPts[10].set(50, 250);
- fPts[11].set(150, 150);
+ fPts[8].set(150 * s, 350 * s);
+ fPts[9].set(100 * s, 300 * s);
+ fPts[10].set(50 * s, 250 * s);
+ fPts[11].set(150 * s, 150 * s);
const SkColor colors[SkPatchUtils::kNumCorners] = {
0xFF5555FF, 0xFF8888FF, 0xFFCCCCFF
diff --git a/samplecode/SampleAnimatedText.cpp b/samplecode/SampleAnimatedText.cpp
index 415cc9f5de..c7c9aa4043 100755
--- a/samplecode/SampleAnimatedText.cpp
+++ b/samplecode/SampleAnimatedText.cpp
@@ -127,7 +127,7 @@ protected:
canvas->restore();
paint.setTextSize(16);
- canvas->drawText(outString.c_str(), outString.size(), 512.f, 540.f, paint);
+// canvas->drawText(outString.c_str(), outString.size(), 512.f, 540.f, paint);
canvas->drawText(modeString.c_str(), modeString.size(), 768.f, 540.f, paint);
}
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index df83d4dea5..c71fda5f9d 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1441,6 +1441,7 @@ void SampleWindow::afterChildren(SkCanvas* orig) {
// Do this after presentGL and other finishing, rather than in afterChild
if (fMeasureFPS) {
+ orig->flush();
fTimer.end();
fMeasureFPS_Time += fTimer.fWall;
}