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

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: 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..a0d7ab8fe8041647a8bac3f0555b50536355d6f4 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);
+ // Returns pointer to SkData. Caller needs to unref it, according to contract in
Noel Gordon 2015/12/04 03:28:03 How about ... Return our encoded image data. Call
aleksandar.stojiljkovic 2015/12/04 11:11:43 Done.
+ // SkImageGenerator::refEncodedData.
+ SkData* refEncodedData() const;
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