| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| index f57e875ea4357b0d9e9923e765f891a225702292..fc74f13b75eaf385ef5ef2d985b8cbc77280ab6c 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -476,13 +476,6 @@
|
| return AtomicString(toDataURLInternal("image/png", 0, FrontBuffer));
|
| }
|
|
|
| -void HTMLCanvasElement::prepareSurfaceForPaintingIfNeeded() const
|
| -{
|
| - ASSERT(m_context && m_context->is2d()); // This function is called by the 2d context
|
| - if (buffer())
|
| - m_imageBuffer->prepareSurfaceForPaintingIfNeeded();
|
| -}
|
| -
|
| ImageData* HTMLCanvasElement::toImageData(SourceDrawingBuffer sourceBuffer) const
|
| {
|
| ImageData* imageData;
|
| @@ -494,7 +487,7 @@
|
|
|
| m_context->paintRenderingResultsToCanvas(sourceBuffer);
|
| imageData = ImageData::create(m_size);
|
| - RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration);
|
| + RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot();
|
| if (snapshot) {
|
| SkImageInfo imageInfo = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);
|
| snapshot->readPixels(imageInfo, imageData->data()->data(), imageInfo.minRowBytes(), 0, 0);
|
| @@ -508,7 +501,7 @@
|
| return imageData;
|
|
|
| ASSERT(m_context->is2d());
|
| - RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration);
|
| + RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot();
|
| if (snapshot) {
|
| SkImageInfo imageInfo = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);
|
| snapshot->readPixels(imageInfo, imageData->data()->data(), imageInfo.minRowBytes(), 0, 0);
|
| @@ -679,7 +672,7 @@
|
| if (shouldAccelerate(deviceSize)) {
|
| if (document().settings())
|
| *msaaSampleCount = document().settings()->accelerated2dCanvasMSAASampleCount();
|
| - OwnPtr<ImageBufferSurface> surface = adoptPtr(new Canvas2DImageBufferSurface(deviceSize, *msaaSampleCount, opacityMode, Canvas2DLayerBridge::EnableAcceleration));
|
| + OwnPtr<ImageBufferSurface> surface = adoptPtr(new Canvas2DImageBufferSurface(deviceSize, opacityMode, *msaaSampleCount));
|
| if (surface->isValid())
|
| return surface.release();
|
| }
|
| @@ -843,7 +836,7 @@
|
| m_didFailToCreateImageBuffer = !m_imageBuffer;
|
| }
|
|
|
| -PassRefPtr<Image> HTMLCanvasElement::copiedImage(SourceDrawingBuffer sourceBuffer, AccelerationHint hint) const
|
| +PassRefPtr<Image> HTMLCanvasElement::copiedImage(SourceDrawingBuffer sourceBuffer) const
|
| {
|
| if (!isPaintable())
|
| return nullptr;
|
| @@ -855,7 +848,7 @@
|
| if (m_context->is3d())
|
| needToUpdate |= m_context->paintRenderingResultsToCanvas(sourceBuffer);
|
| if (needToUpdate && buffer()) {
|
| - m_copiedImage = buffer()->newImageSnapshot(hint);
|
| + m_copiedImage = buffer()->newImageSnapshot();
|
| updateExternallyAllocatedMemory();
|
| }
|
| return m_copiedImage;
|
| @@ -910,7 +903,7 @@
|
| HTMLElement::didMoveToNewDocument(oldDocument);
|
| }
|
|
|
| -PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageStatus* status, AccelerationHint hint) const
|
| +PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageStatus* status) const
|
| {
|
| if (!width() || !height()) {
|
| *status = ZeroSizeCanvasSourceImageStatus;
|
| @@ -931,7 +924,7 @@
|
| m_context->paintRenderingResultsToCanvas(BackBuffer);
|
| }
|
|
|
| - RefPtr<SkImage> image = buffer()->newSkImageSnapshot(hint);
|
| + RefPtr<SkImage> image = buffer()->newSkImageSnapshot();
|
| if (image) {
|
| *status = NormalSourceImageStatus;
|
| return StaticBitmapImage::create(image.release());
|
|
|