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

Unified Diff: Source/platform/graphics/ImageBuffer.h

Issue 837643002: Remove Uint8ClampedArray use from ImageBuffer.h ImageDataBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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: Source/platform/graphics/ImageBuffer.h
diff --git a/Source/platform/graphics/ImageBuffer.h b/Source/platform/graphics/ImageBuffer.h
index 1a79ba298fe3ff694a795b37e31cb3ae3ffa533d..55ccb8aafc53b9662bc059d2b1db23a433342ff6 100644
--- a/Source/platform/graphics/ImageBuffer.h
+++ b/Source/platform/graphics/ImageBuffer.h
@@ -43,7 +43,6 @@
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/Uint8ClampedArray.h"
namespace WTF {
@@ -161,13 +160,10 @@ private:
OwnPtr<DisplayItemList> m_displayItemList;
};
-struct ImageDataBuffer {
- ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m_size(size), m_data(data) { }
- IntSize size() const { return m_size; }
- unsigned char* data() const { return m_data->data(); }
-
- IntSize m_size;
- RefPtr<Uint8ClampedArray> m_data;
+struct ImageDataBuffer : public IntSize {
Yuki 2015/01/07 13:00:57 ImageDataBuffer is not a size. So we shouldn't in
Yuki 2015/01/07 14:42:06 It's simply because an image is not a size. An im
Yuki 2015/01/08 04:32:38 If ImageDataBuffer inherits from IntSize, ImageDat
+ ImageDataBuffer(const IntSize& size, unsigned char* data) : IntSize(size), m_data(data) { }
+ unsigned char* pixels() const { return m_data; }
+ unsigned char* m_data;
};
String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);

Powered by Google App Engine
This is Rietveld 408576698