Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@14584 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2014-05-06 03:06:53 +00:00
parent cf800e0486
commit edda70e020
5 changed files with 18 additions and 19 deletions

View File

@ -18,23 +18,23 @@
static SkShader* make_shader(SkXfermode::Mode mode) { static SkShader* make_shader(SkXfermode::Mode mode) {
SkPoint pts[2]; SkPoint pts[2];
SkColor colors[2]; SkColor colors[2];
pts[0].set(0, 0); pts[0].set(0, 0);
pts[1].set(SkIntToScalar(100), 0); pts[1].set(SkIntToScalar(100), 0);
colors[0] = SK_ColorRED; colors[0] = SK_ColorRED;
colors[1] = SK_ColorBLUE; colors[1] = SK_ColorBLUE;
SkAutoTUnref<SkShader> shaderA(SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkAutoTUnref<SkShader> shaderA(SkGradientShader::CreateLinear(pts, colors, NULL, 2,
SkShader::kClamp_TileMode)); SkShader::kClamp_TileMode));
pts[0].set(0, 0); pts[0].set(0, 0);
pts[1].set(0, SkIntToScalar(100)); pts[1].set(0, SkIntToScalar(100));
colors[0] = SK_ColorBLACK; colors[0] = SK_ColorBLACK;
colors[1] = SkColorSetARGB(0x80, 0, 0, 0); colors[1] = SkColorSetARGB(0x80, 0, 0, 0);
SkAutoTUnref<SkShader> shaderB(SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkAutoTUnref<SkShader> shaderB(SkGradientShader::CreateLinear(pts, colors, NULL, 2,
SkShader::kClamp_TileMode)); SkShader::kClamp_TileMode));
SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(mode)); SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(mode));
return SkNEW_ARGS(SkComposeShader, (shaderA, shaderB, xfer)); return SkNEW_ARGS(SkComposeShader, (shaderA, shaderB, xfer));
} }
@ -86,7 +86,7 @@ protected:
virtual SkString onShortName() SK_OVERRIDE { virtual SkString onShortName() SK_OVERRIDE {
return SkString("composeshader_alpha"); return SkString("composeshader_alpha");
} }
virtual SkISize onISize() SK_OVERRIDE { virtual SkISize onISize() SK_OVERRIDE {
return SkISize::Make(220, 750); return SkISize::Make(220, 750);
} }
@ -103,9 +103,9 @@ protected:
SkPaint paint; SkPaint paint;
paint.setColor(SK_ColorGREEN); paint.setColor(SK_ColorGREEN);
const SkRect r = SkRect::MakeXYWH(5, 5, 100, 100); const SkRect r = SkRect::MakeXYWH(5, 5, 100, 100);
for (size_t y = 0; y < SK_ARRAY_COUNT(shaders); ++y) { for (size_t y = 0; y < SK_ARRAY_COUNT(shaders); ++y) {
SkShader* shader = shaders[y]; SkShader* shader = shaders[y];
canvas->save(); canvas->save();
@ -113,11 +113,11 @@ protected:
paint.setAlpha(0xFF); paint.setAlpha(0xFF);
paint.setShader(NULL); paint.setShader(NULL);
canvas->drawRect(r, paint); canvas->drawRect(r, paint);
paint.setAlpha(alpha); paint.setAlpha(alpha);
paint.setShader(shader); paint.setShader(shader);
canvas->drawRect(r, paint); canvas->drawRect(r, paint);
canvas->translate(r.width() + 5, 0); canvas->translate(r.width() + 5, 0);
} }
canvas->restore(); canvas->restore();
@ -130,4 +130,3 @@ protected:
DEF_GM( return new ComposeShaderGM; ) DEF_GM( return new ComposeShaderGM; )
DEF_GM( return new ComposeShaderAlphaGM; ) DEF_GM( return new ComposeShaderAlphaGM; )

View File

@ -101,13 +101,13 @@ SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, vo
if (!fRawBitmap.getTexture() && !valid_for_drawing(fRawBitmap)) { if (!fRawBitmap.getTexture() && !valid_for_drawing(fRawBitmap)) {
return NULL; return NULL;
} }
SkMatrix totalInverse; SkMatrix totalInverse;
// Do this first, so we know the matrix can be inverted. // Do this first, so we know the matrix can be inverted.
if (!this->computeTotalInverse(rec, &totalInverse)) { if (!this->computeTotalInverse(rec, &totalInverse)) {
return NULL; return NULL;
} }
void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
SkBitmapProcState* state = SkNEW_PLACEMENT(stateStorage, SkBitmapProcState); SkBitmapProcState* state = SkNEW_PLACEMENT(stateStorage, SkBitmapProcState);

View File

@ -93,7 +93,7 @@ SkShader::Context* SkComposeShader::onCreateContext(const ContextRec& rec, void*
// sub-shaders. // sub-shaders.
SkPaint opaquePaint(*rec.fPaint); SkPaint opaquePaint(*rec.fPaint);
opaquePaint.setAlpha(0xFF); opaquePaint.setAlpha(0xFF);
ContextRec newRec(rec); ContextRec newRec(rec);
newRec.fMatrix = &tmpM; newRec.fMatrix = &tmpM;
newRec.fPaint = &opaquePaint; newRec.fPaint = &opaquePaint;

View File

@ -43,7 +43,7 @@ protected:
SkFilterShader(SkReadBuffer& ); SkFilterShader(SkReadBuffer& );
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE;
private: private:
SkShader* fShader; SkShader* fShader;

View File

@ -57,23 +57,23 @@ private:
SkShader* bitmapShader); SkShader* bitmapShader);
virtual ~PictureShaderContext(); virtual ~PictureShaderContext();
virtual uint32_t getFlags() const SK_OVERRIDE; virtual uint32_t getFlags() const SK_OVERRIDE;
virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) 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; virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
private: private:
PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader* bitmapShader); PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader* bitmapShader);
SkAutoTUnref<SkShader> fBitmapShader; SkAutoTUnref<SkShader> fBitmapShader;
SkShader::Context* fBitmapShaderContext; SkShader::Context* fBitmapShaderContext;
void* fBitmapShaderContextStorage; void* fBitmapShaderContextStorage;
typedef SkShader::Context INHERITED; typedef SkShader::Context INHERITED;
}; };
typedef SkShader INHERITED; typedef SkShader INHERITED;
}; };