Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1361043003: Revert of Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.h ('k') | third_party/WebKit/Source/core/html/HTMLImageElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698