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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 1382883002: Fixing performance issue of creating imagebitmap from ImageData (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/platform/graphics/ImageBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
index d63909e4b47783dfea59bfdc68f16d8b8df9cda8..df902c960517c4c27b1e137126dee76fa1e68c57 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
@@ -41,6 +41,7 @@
#include "platform/graphics/ImageBufferClient.h"
#include "platform/graphics/StaticBitmapImage.h"
#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/UnacceleratedSimpleImageBufferSurface.h"
#include "platform/graphics/gpu/DrawingBuffer.h"
#include "platform/graphics/gpu/Extensions3DUtil.h"
#include "platform/graphics/skia/SkiaUtils.h"
@@ -75,6 +76,14 @@ PassOwnPtr<ImageBuffer> ImageBuffer::create(const IntSize& size, OpacityMode opa
return adoptPtr(new ImageBuffer(surface.release()));
}
+PassOwnPtr<ImageBuffer> ImageBuffer::createSimple(const IntSize& size, OpacityMode opacityMode)
+{
+ OwnPtr<ImageBufferSurface> surface(adoptPtr(new UnacceleratedSimpleImageBufferSurface(size, opacityMode)));
+ if (!surface->isValid())
+ return nullptr;
+ return adoptPtr(new ImageBuffer(surface.release()));
+}
+
ImageBuffer::ImageBuffer(PassOwnPtr<ImageBufferSurface> surface)
: m_snapshotState(InitialSnapshotState)
, m_surface(surface)

Powered by Google App Engine
This is Rietveld 408576698