Chromium Code Reviews| Index: Source/platform/graphics/ImageBuffer.cpp |
| diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp |
| index 12a631e173a4618d5632b44681869de5f3be4717..095d86452f6e366e820cac887ebb6375eaa55d07 100644 |
| --- a/Source/platform/graphics/ImageBuffer.cpp |
| +++ b/Source/platform/graphics/ImageBuffer.cpp |
| @@ -149,6 +149,9 @@ void ImageBuffer::resetCanvas(SkCanvas* canvas) const |
| PassRefPtr<SkImage> ImageBuffer::newSkImageSnapshot() const |
| { |
| + if (m_animationState == InitialAnimationState) |
| + m_animationState = DidAcquireSnapshot; |
|
Stephen White
2015/08/17 15:15:07
Naming nit: m_drawnToAfterSnapshot or something li
|
| + |
| if (!isSurfaceValid()) |
| return nullptr; |
| return m_surface->newImageSnapshot(); |
| @@ -156,14 +159,19 @@ PassRefPtr<SkImage> ImageBuffer::newSkImageSnapshot() const |
| PassRefPtr<Image> ImageBuffer::newImageSnapshot() const |
| { |
| - if (!isSurfaceValid()) |
| - return nullptr; |
| - RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(); |
| + RefPtr<SkImage> snapshot = newSkImageSnapshot(); |
| if (!snapshot) |
| return nullptr; |
| return StaticBitmapImage::create(snapshot); |
| } |
| +void ImageBuffer::didDraw(const FloatRect& rect) const |
| +{ |
| + if (m_animationState == DidAcquireSnapshot) |
| + m_animationState = DidDrawAfterSnapshot; |
| + m_surface->didDraw(rect); |
| +} |
| + |
| WebLayer* ImageBuffer::platformLayer() const |
| { |
| return m_surface->layer(); |