| Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
|
| diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
|
| index 87c61553bbf6441278890508e9e323db66d2a90e..3e5a29fa1b95513189c24f569c39a3fc2181d588 100644
|
| --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
|
| +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
|
| @@ -1376,7 +1376,8 @@ void CanvasRenderingContext2D::drawImage(CanvasImageSource* imageSource,
|
| RefPtr<Image> image;
|
| SourceImageStatus sourceImageStatus = InvalidSourceImageStatus;
|
| if (!imageSource->isVideoElement()) {
|
| - image = imageSource->getSourceImageForCanvas(&sourceImageStatus);
|
| + AccelerationHint hint = canvas()->buffer()->isAccelerated() ? PreferAcceleration : PreferNoAcceleration;
|
| + image = imageSource->getSourceImageForCanvas(&sourceImageStatus, hint);
|
| if (sourceImageStatus == UndecodableSourceImageStatus)
|
| exceptionState.throwDOMException(InvalidStateError, "The HTMLImageElement provided is in the 'broken' state.");
|
| if (!image || !image->width() || !image->height())
|
| @@ -1484,7 +1485,7 @@ CanvasPattern* CanvasRenderingContext2D::createPattern(const CanvasImageSourceUn
|
|
|
| SourceImageStatus status;
|
| CanvasImageSource* imageSourceInternal = toImageSourceInternal(imageSource);
|
| - RefPtr<Image> imageForRendering = imageSourceInternal->getSourceImageForCanvas(&status);
|
| + RefPtr<Image> imageForRendering = imageSourceInternal->getSourceImageForCanvas(&status, PreferNoAcceleration);
|
|
|
| switch (status) {
|
| case NormalSourceImageStatus:
|
| @@ -1774,6 +1775,10 @@ void CanvasRenderingContext2D::schedulePruneLocalFontCacheIfNeeded()
|
|
|
| void CanvasRenderingContext2D::didProcessTask()
|
| {
|
| + // The rendering surface needs to be prepared now because it will be too late
|
| + // to create a layer once we are in the paint invalidation phase.
|
| + canvas()->prepareSurfaceForPaintingIfNeeded();
|
| +
|
| pruneLocalFontCache(canvas()->document().canvasFontCache()->maxFonts());
|
| m_pruneLocalFontCacheScheduled = false;
|
| Platform::current()->currentThread()->removeTaskObserver(this);
|
|
|