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

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

Issue 1382883002: Fixing performance issue of creating imagebitmap from ImageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the benchmark test which has been landed already Created 5 years, 2 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/UnacceleratedImageBufferSurface.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
index f01b7a7c7a05ab75ca9b3ab42603c815cefebff0..0dac45b7c250c996aea3df9a364e5f7a4fade1f3 100644
--- a/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
+++ b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -38,7 +38,7 @@
namespace blink {
-UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
+UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode, ImageBitmapSourceType sourceType)
: ImageBufferSurface(size, opacityMode)
{
SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
@@ -46,8 +46,10 @@ UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize&
SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry);
m_surface = adoptRef(SkSurface::NewRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps));
- if (m_surface)
- clear();
+ if (sourceType == NotFromImageData) {
+ if (m_surface)
+ clear();
+ }
}
UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() { }

Powered by Google App Engine
This is Rietveld 408576698