From edda70e020630103270c815b7499e8b02271875d Mon Sep 17 00:00:00 2001 From: "skia.committer@gmail.com" Date: Tue, 6 May 2014 03:06:53 +0000 Subject: [PATCH] Sanitizing source files in Housekeeper-Nightly git-svn-id: http://skia.googlecode.com/svn/trunk@14584 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/composeshader.cpp | 19 +++++++++---------- src/core/SkBitmapProcShader.cpp | 4 ++-- src/core/SkComposeShader.cpp | 2 +- src/core/SkFilterShader.h | 2 +- src/core/SkPictureShader.h | 10 +++++----- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp index 302c17291..e460ceaf7 100644 --- a/gm/composeshader.cpp +++ b/gm/composeshader.cpp @@ -18,23 +18,23 @@ static SkShader* make_shader(SkXfermode::Mode mode) { SkPoint pts[2]; SkColor colors[2]; - + pts[0].set(0, 0); pts[1].set(SkIntToScalar(100), 0); colors[0] = SK_ColorRED; colors[1] = SK_ColorBLUE; SkAutoTUnref shaderA(SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode)); - + pts[0].set(0, 0); pts[1].set(0, SkIntToScalar(100)); colors[0] = SK_ColorBLACK; colors[1] = SkColorSetARGB(0x80, 0, 0, 0); SkAutoTUnref shaderB(SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode)); - + SkAutoTUnref xfer(SkXfermode::Create(mode)); - + return SkNEW_ARGS(SkComposeShader, (shaderA, shaderB, xfer)); } @@ -86,7 +86,7 @@ protected: virtual SkString onShortName() SK_OVERRIDE { return SkString("composeshader_alpha"); } - + virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(220, 750); } @@ -103,9 +103,9 @@ protected: SkPaint paint; paint.setColor(SK_ColorGREEN); - + const SkRect r = SkRect::MakeXYWH(5, 5, 100, 100); - + for (size_t y = 0; y < SK_ARRAY_COUNT(shaders); ++y) { SkShader* shader = shaders[y]; canvas->save(); @@ -113,11 +113,11 @@ protected: paint.setAlpha(0xFF); paint.setShader(NULL); canvas->drawRect(r, paint); - + paint.setAlpha(alpha); paint.setShader(shader); canvas->drawRect(r, paint); - + canvas->translate(r.width() + 5, 0); } canvas->restore(); @@ -130,4 +130,3 @@ protected: DEF_GM( return new ComposeShaderGM; ) DEF_GM( return new ComposeShaderAlphaGM; ) - diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index 503269ac1..00d938be2 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -101,13 +101,13 @@ SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, vo if (!fRawBitmap.getTexture() && !valid_for_drawing(fRawBitmap)) { return NULL; } - + SkMatrix totalInverse; // Do this first, so we know the matrix can be inverted. if (!this->computeTotalInverse(rec, &totalInverse)) { return NULL; } - + void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); SkBitmapProcState* state = SkNEW_PLACEMENT(stateStorage, SkBitmapProcState); diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp index 7a7dce66a..b2f69b4b6 100644 --- a/src/core/SkComposeShader.cpp +++ b/src/core/SkComposeShader.cpp @@ -93,7 +93,7 @@ SkShader::Context* SkComposeShader::onCreateContext(const ContextRec& rec, void* // sub-shaders. SkPaint opaquePaint(*rec.fPaint); opaquePaint.setAlpha(0xFF); - + ContextRec newRec(rec); newRec.fMatrix = &tmpM; newRec.fPaint = &opaquePaint; diff --git a/src/core/SkFilterShader.h b/src/core/SkFilterShader.h index 3f983e26d..1a4b71fe4 100644 --- a/src/core/SkFilterShader.h +++ b/src/core/SkFilterShader.h @@ -43,7 +43,7 @@ protected: SkFilterShader(SkReadBuffer& ); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; - + private: SkShader* fShader; diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h index 178820555..0fbfbee44 100644 --- a/src/core/SkPictureShader.h +++ b/src/core/SkPictureShader.h @@ -57,23 +57,23 @@ private: SkShader* bitmapShader); virtual ~PictureShaderContext(); - + virtual uint32_t getFlags() const SK_OVERRIDE; - + virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE; - + private: PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader* bitmapShader); SkAutoTUnref fBitmapShader; SkShader::Context* fBitmapShaderContext; void* fBitmapShaderContextStorage; - + typedef SkShader::Context INHERITED; }; - + typedef SkShader INHERITED; };