зеркало из https://github.com/mozilla/moz-skia.git
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:
Родитель
cf800e0486
Коммит
edda70e020
|
@ -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<SkShader> 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<SkShader> shaderB(SkGradientShader::CreateLinear(pts, colors, NULL, 2,
|
||||
SkShader::kClamp_TileMode));
|
||||
|
||||
|
||||
SkAutoTUnref<SkXfermode> 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; )
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<SkShader> fBitmapShader;
|
||||
SkShader::Context* fBitmapShaderContext;
|
||||
void* fBitmapShaderContextStorage;
|
||||
|
||||
|
||||
typedef SkShader::Context INHERITED;
|
||||
};
|
||||
|
||||
|
||||
typedef SkShader INHERITED;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче