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

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: Change enum type name and remove temps 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e38d85f0be71a481f8723dfa554457278ae03dd8 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, ImageInitializationMode initializationMode)
: 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 (initializationMode == DoNotInitializeImagePixels) {
rickyz (no longer on Chrome) 2016/01/19 23:34:49 Is this logic correct? Shouldn't this clear initia
rickyz (no longer on Chrome) 2016/01/19 23:43:10 Never mind, I see that this was fixed in a later C
+ if (m_surface)
+ clear();
+ }
}
UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() { }
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698