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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 1407133017: Cleanup some dead code in blink::ImageBuffer and friends (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index d1efb9d01704d2878401f671a72d7aff1902d7ab..c8b928e6ba2d410cba0eae8b5697184f5e3e19a7 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -876,11 +876,6 @@ void DrawingBuffer::setPackAlignment(GLint param)
m_packAlignment = param;
}
-void DrawingBuffer::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer)
-{
- paintFramebufferToCanvas(framebuffer(), size().width(), size().height(), !m_actualAttributes.premultipliedAlpha, imageBuffer);
-}
-
bool DrawingBuffer::paintRenderingResultsToImageData(int& width, int& height, SourceDrawingBuffer sourceBuffer, WTF::ArrayBufferContents& contents)
{
ASSERT(!m_actualAttributes.premultipliedAlpha);
@@ -918,45 +913,6 @@ bool DrawingBuffer::paintRenderingResultsToImageData(int& width, int& height, So
return true;
}
-void DrawingBuffer::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
-{
- unsigned char* pixels = 0;
-
- const SkBitmap& canvasBitmap = imageBuffer->deprecatedBitmapForOverwrite();
- const SkBitmap* readbackBitmap = 0;
- ASSERT(canvasBitmap.colorType() == kN32_SkColorType);
- if (canvasBitmap.width() == width && canvasBitmap.height() == height) {
- // This is the fastest and most common case. We read back
- // directly into the canvas's backing store.
- readbackBitmap = &canvasBitmap;
- m_resizingBitmap.reset();
- } else {
- // We need to allocate a temporary bitmap for reading back the
- // pixel data. We will then use Skia to rescale this bitmap to
- // the size of the canvas's backing store.
- if (m_resizingBitmap.width() != width || m_resizingBitmap.height() != height) {
- if (!m_resizingBitmap.tryAllocN32Pixels(width, height))
- return;
- }
- readbackBitmap = &m_resizingBitmap;
- }
-
- // Read back the frame buffer.
- SkAutoLockPixels bitmapLock(*readbackBitmap);
- pixels = static_cast<unsigned char*>(readbackBitmap->getPixels());
-
- m_context->bindFramebuffer(GL_FRAMEBUFFER, framebuffer);
- readBackFramebuffer(pixels, width, height, ReadbackSkia, premultiplyAlpha ? WebGLImageConversion::AlphaDoPremultiply : WebGLImageConversion::AlphaDoNothing);
- flipVertically(pixels, width, height);
-
- readbackBitmap->notifyPixelsChanged();
- if (m_resizingBitmap.readyToDraw()) {
- // We need to draw the resizing bitmap into the canvas's backing store.
- SkCanvas canvas(canvasBitmap);
- canvas.drawBitmapRect(m_resizingBitmap, SkRect::MakeIWH(canvasBitmap.width(), canvasBitmap.height()), nullptr);
- }
-}
-
void DrawingBuffer::readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder readbackOrder, WebGLImageConversion::AlphaOp op)
{
if (m_packAlignment > 4)

Powered by Google App Engine
This is Rietveld 408576698