diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp index 302c17291a..e460ceaf7c 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 503269ac10..00d938be27 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 7a7dce66a0..b2f69b4b69 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 3f983e26d9..1a4b71fe46 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 1788205558..0fbfbee444 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; };