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

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: rebase to gtest update 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 113ea88f53b0dfd18793d08da2c9dc3fc7307b02..0f840f93a2ef17dda79d2a39bc668c854b130668 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/ThreadingPrimitives.h"
#include "wtf/Vector.h"
+class SkData;
+
namespace blink {
class ImageDecoder;
@@ -75,8 +77,11 @@ 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.
+ //
+ // Returns null if image is not complete.
Noel Gordon 2015/12/08 15:41:59 "Returns null if image is not complete", not quite
aleksandar.stojiljkovic 2015/12/08 20:28:13 Done. "Fully received" used on other place.
+ SkData* refEncodedData();
const SkISize& getFullSize() const { return m_fullSize; }
@@ -104,7 +109,11 @@ private:
bool decode(size_t index, ImageDecoder**, SkBitmap*);
SkISize m_fullSize;
- ThreadSafeDataTransport m_data;
+
+ // ThreadSafeDataTransport is referenced by this class and m_encodedData.
+ // In case that ImageFrameGenerator get's deleted before m_encodedData,
+ // m_encodedData would hold the reference to it (and underlying data).
+ RefPtr<ThreadSafeDataTransport> m_data;
bool m_isMultiFrame;
bool m_decodeFailedAndEmpty;
Vector<bool> m_hasAlpha;
@@ -123,6 +132,9 @@ private:
// Protect concurrent access to m_hasAlpha.
Mutex m_alphaMutex;
+ // Our encoded image data returned in refEncodedData.
+ SkData* m_encodedData;
+
#if COMPILER(MSVC)
friend struct ::WTF::OwnedPtrDeleter<ExternalMemoryAllocator>;
#endif

Powered by Google App Engine
This is Rietveld 408576698