SkyShell DCHECKs on startup sometimes

Sometimes we try to draw a 0x0 picture. We shouldn't bother trying to turn a
0x0 picture into actual pixels.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/984153004
This commit is contained in:
Adam Barth 2015-03-09 16:19:33 -07:00
parent 31489a771b
commit 1a573cf3eb

View File

@ -44,9 +44,13 @@ void Rasterizer::Draw(skia::RefPtr<SkPicture> picture) {
if (!surface_)
return;
gfx::Size size = GetSize(picture.get());
if (size.IsEmpty())
return;
EnsureGLContext();
CHECK(context_->MakeCurrent(surface_.get()));
EnsureGaneshSurface(GetSize(picture.get()));
EnsureGaneshSurface(size);
SkCanvas* canvas = ganesh_surface_->canvas();
canvas->drawPicture(picture.get());