Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12555 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
3e7f385336
commit
56710d1905
@ -14,27 +14,27 @@
|
||||
namespace skiagm {
|
||||
|
||||
static void draw_bm(SkBitmap* bm) {
|
||||
SkPaint bluePaint;
|
||||
bluePaint.setColor(SK_ColorBLUE);
|
||||
SkPaint bluePaint;
|
||||
bluePaint.setColor(SK_ColorBLUE);
|
||||
|
||||
bm->setConfig(SkBitmap::kARGB_8888_Config, 20, 20);
|
||||
bm->allocPixels();
|
||||
bm->eraseColor(SK_ColorRED);
|
||||
bm->setConfig(SkBitmap::kARGB_8888_Config, 20, 20);
|
||||
bm->allocPixels();
|
||||
bm->eraseColor(SK_ColorRED);
|
||||
|
||||
SkCanvas canvas(*bm);
|
||||
canvas.drawCircle(10, 10, 5, bluePaint);
|
||||
SkCanvas canvas(*bm);
|
||||
canvas.drawCircle(10, 10, 5, bluePaint);
|
||||
}
|
||||
|
||||
static void draw_mask(SkBitmap* bm) {
|
||||
SkPaint circlePaint;
|
||||
circlePaint.setColor(SK_ColorBLACK);
|
||||
SkPaint circlePaint;
|
||||
circlePaint.setColor(SK_ColorBLACK);
|
||||
|
||||
bm->setConfig(SkBitmap::kA8_Config, 20, 20);
|
||||
bm->allocPixels();
|
||||
bm->eraseColor(SK_ColorTRANSPARENT);
|
||||
bm->setConfig(SkBitmap::kA8_Config, 20, 20);
|
||||
bm->allocPixels();
|
||||
bm->eraseColor(SK_ColorTRANSPARENT);
|
||||
|
||||
SkCanvas canvas(*bm);
|
||||
canvas.drawCircle(10, 10, 10, circlePaint);
|
||||
SkCanvas canvas(*bm);
|
||||
canvas.drawCircle(10, 10, 10, circlePaint);
|
||||
}
|
||||
|
||||
class BitmapShaderGM : public GM {
|
||||
@ -56,36 +56,36 @@ protected:
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
SkShader* shader = SkShader::CreateBitmapShader(fBitmap,
|
||||
SkShader::kClamp_TileMode,
|
||||
SkShader::kClamp_TileMode);
|
||||
SkPaint paint;
|
||||
paint.setShader(shader);
|
||||
// release the shader ref as the paint now holds a reference
|
||||
shader->unref();
|
||||
SkShader* shader = SkShader::CreateBitmapShader(fBitmap,
|
||||
SkShader::kClamp_TileMode,
|
||||
SkShader::kClamp_TileMode);
|
||||
SkPaint paint;
|
||||
paint.setShader(shader);
|
||||
// release the shader ref as the paint now holds a reference
|
||||
shader->unref();
|
||||
|
||||
// draw the shader with a bitmap mask
|
||||
canvas->drawBitmap(fMask, 0, 0, &paint);
|
||||
canvas->drawBitmap(fMask, 30, 0, &paint);
|
||||
// draw the shader with a bitmap mask
|
||||
canvas->drawBitmap(fMask, 0, 0, &paint);
|
||||
canvas->drawBitmap(fMask, 30, 0, &paint);
|
||||
|
||||
canvas->translate(0, 25);
|
||||
canvas->translate(0, 25);
|
||||
|
||||
// draw the shader with standard geometry
|
||||
canvas->drawCircle(10, 10, 10, paint);
|
||||
canvas->drawCircle(40, 10, 10, paint); // no blue circle expected
|
||||
// draw the shader with standard geometry
|
||||
canvas->drawCircle(10, 10, 10, paint);
|
||||
canvas->drawCircle(40, 10, 10, paint); // no blue circle expected
|
||||
|
||||
canvas->translate(0, 25);
|
||||
canvas->translate(0, 25);
|
||||
|
||||
shader = SkShader::CreateBitmapShader(fMask,
|
||||
SkShader::kRepeat_TileMode,
|
||||
SkShader::kRepeat_TileMode);
|
||||
paint.setShader(shader);
|
||||
paint.setColor(SK_ColorRED);
|
||||
shader->unref();
|
||||
shader = SkShader::CreateBitmapShader(fMask,
|
||||
SkShader::kRepeat_TileMode,
|
||||
SkShader::kRepeat_TileMode);
|
||||
paint.setShader(shader);
|
||||
paint.setColor(SK_ColorRED);
|
||||
shader->unref();
|
||||
|
||||
// draw the mask using the shader and a color
|
||||
canvas->drawRect(SkRect::MakeXYWH(0, 0, 20, 20), paint);
|
||||
canvas->drawRect(SkRect::MakeXYWH(30, 0, 20, 20), paint);
|
||||
// draw the mask using the shader and a color
|
||||
canvas->drawRect(SkRect::MakeXYWH(0, 0, 20, 20), paint);
|
||||
canvas->drawRect(SkRect::MakeXYWH(30, 0, 20, 20), paint);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user