Remove wrong file, add right file

git-svn-id: http://skia.googlecode.com/svn/trunk@2257 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-09-13 15:39:00 +00:00
parent 8c2fe99ed2
commit cecd3ac9d0

View File

@ -6,6 +6,7 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
#include "gm.h" #include "gm.h"
#include "SkGradientShader.h"
namespace skiagm { namespace skiagm {
@ -72,9 +73,12 @@ protected:
virtual void onDraw(SkCanvas* canvas) { virtual void onDraw(SkCanvas* canvas) {
// do perspective drawPaint as the background; // do perspective drawPaint as the background;
SkPaint bkgnrd; SkPaint bkgnrd;
SkPoint center = SkPoint::Make(SkIntToScalar(100), SkIntToScalar(100)); SkPoint center = SkPoint::Make(SkIntToScalar(100),
SkColor colors[] = {SK_ColorBLACK, SK_ColorGREEN, SK_ColorYELLOW, SK_ColorWHITE}; SkIntToScalar(100));
SkScalar pos[] = {0, SK_ScalarHalf / 2, 3 * SK_ScalarHalf / 2, SK_Scalar1}; SkColor colors[] = {SK_ColorBLACK, SK_ColorCYAN,
SK_ColorYELLOW, SK_ColorWHITE};
SkScalar pos[] = {0, SK_ScalarHalf / 2,
3 * SK_ScalarHalf / 2, SK_Scalar1};
SkShader* s = SkGradientShader::CreateRadial(center, SkShader* s = SkGradientShader::CreateRadial(center,
SkIntToScalar(1000), SkIntToScalar(1000),
colors, colors,
@ -86,7 +90,7 @@ protected:
canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); canvas->translate(SkIntToScalar(100), SkIntToScalar(100));
SkMatrix mat; SkMatrix mat;
mat.reset(); mat.reset();
mat.setPerspY(SK_Scalar1 / 300); mat.setPerspY(SK_Scalar1 / 1000);
canvas->concat(mat); canvas->concat(mat);
canvas->drawPaint(bkgnrd); canvas->drawPaint(bkgnrd);
canvas->restore(); canvas->restore();
@ -94,7 +98,8 @@ protected:
// draw the paths in perspective // draw the paths in perspective
SkMatrix persp; SkMatrix persp;
persp.reset(); persp.reset();
persp.setPerspX(-SK_Scalar1 / 300); persp.setPerspX(-SK_Scalar1 / 1800);
persp.setPerspY(SK_Scalar1 / 500);
canvas->concat(persp); canvas->concat(persp);
canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
@ -102,12 +107,12 @@ protected:
showFour(canvas, SK_Scalar1, false); showFour(canvas, SK_Scalar1, false);
canvas->translate(SkIntToScalar(450), 0); canvas->translate(SkIntToScalar(450), 0);
showFour(canvas, scale, paint); showFour(canvas, scale, false);
canvas->translate(SkIntToScalar(-450), SkIntToScalar(450)); canvas->translate(SkIntToScalar(-450), SkIntToScalar(450));
showFour(canvas, SK_Scalar1, true); showFour(canvas, SK_Scalar1, true);
canvas->translate(SkIntToScalar(450), 0); canvas->translate(SkIntToScalar(450), 0);
showFour(canvas, scale, paint); showFour(canvas, scale, true);
} }
private: private:
@ -116,7 +121,7 @@ private:
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
static GM* MyFactory(void*) { return new FillTypeGM; } static GM* MyFactory(void*) { return new FillTypePerspGM; }
static GMRegistry reg(MyFactory); static GMRegistry reg(MyFactory);
} }