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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h

Issue 1484853003: Ganesh: images upload to GPU performance fix (skip copying encoded data) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment #59 fix. Not using fast malloc as suggested during merge - attempt to fix memory leak intro… Created 5 years 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/ImageFrameGenerator.h
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
index 06664c71efcd8d4b562fa11ad75a1786e45a3593..4846a939b4a78bab70725b1f72c64496d49ef788 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
@@ -41,6 +41,8 @@
#include "wtf/ThreadSafeRefCounted.h"
#include "wtf/Vector.h"
+class SkData;
+
namespace blink {
class ImageDecoder;
@@ -78,8 +80,9 @@ public:
void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
- // Creates a new SharedBuffer containing the data received so far.
- void copyData(RefPtr<SharedBuffer>*, bool* allDataReceived);
+ // Return our encoded image data. Caller takes ownership and must unref the data
+ // according to the contract SkImageGenerator::refEncodedData.
+ SkData* refEncodedData() const;
Noel Gordon 2015/12/04 12:40:30 Noticed one review question about this "Could this
aleksandar.stojiljkovic 2015/12/04 14:31:15 That is handled by const void* SkData::data() cons
scroggo_chromium 2015/12/04 16:15:25 SkData also has writable_data() (https://code.goog
SkISize getFullSize() const { return m_fullSize; }
@@ -107,7 +110,11 @@ private:
bool decode(size_t index, ImageDecoder**, SkBitmap*);
SkISize m_fullSize;
- ThreadSafeDataTransport m_data;
+
+ // ThreadSafeDataTransport is referenced by ImageFrameGenerator and SkData
+ // from refEncodedData. In case ImageFrameGenerator get's deleted, SkData
+ // would hold the reference to it (and underlying data).
+ RefPtr<ThreadSafeDataTransport> m_data;
bool m_isMultiFrame;
bool m_decodeFailedAndEmpty;
Vector<bool> m_hasAlpha;

Powered by Google App Engine
This is Rietveld 408576698