Commit 51c4765d authored by xidachen's avatar xidachen Committed by Commit bot

Do not clear canvas with transparent color after creating SkSurface

Recently SkSurface::MakeRaster changed its implementation to zero its
malloced space. So after creating the SkSurface, there is no need to
call sksurface's canvas->clear(SK_ColorTRANSPARENT). This CL removes
that step.

Review-Url: https://codereview.chromium.org/2119623003
Cr-Commit-Position: refs/heads/master@{#403907}
parent 1c88977a
......@@ -132,7 +132,6 @@ PassRefPtr<Image> createTransparentImage(const IntSize& size)
{
DCHECK(canCreateImageBuffer(size));
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(size.width(), size.height());
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
return StaticBitmapImage::create(fromSkSp(surface->makeImageSnapshot()));
}
......
......@@ -107,7 +107,6 @@ PassRefPtr<SkImage> DragImage::resizeAndOrientImage(PassRefPtr<SkImage> image, I
? kNone_SkFilterQuality : kHigh_SkFilterQuality);
SkCanvas* canvas = surface->getCanvas();
canvas->clear(SK_ColorTRANSPARENT);
canvas->concat(affineTransformToSkMatrix(transform));
canvas->drawImage(image.get(), 0, 0, &paint);
......
......@@ -60,7 +60,6 @@ sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) const
if (!surface)
return SkShader::MakeColorShader(SK_ColorTRANSPARENT);
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
SkPaint paint;
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
surface->getCanvas()->drawImage(m_tileImage, 0, 0, &paint);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment