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

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

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, 1 month 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/ImageFrameGenerator.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/ImageFrameGenerator.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
index b332fd9d54f678d45843a7c906dc1d3ff6805cb7..ec26d177b71fff524042605d3a1243116de798a7 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -117,12 +117,23 @@ void ImageFrameGenerator::setData(PassRefPtr<SharedBuffer> data, bool allDataRec
m_data.setData(data.get(), allDataReceived);
}
-void ImageFrameGenerator::copyData(RefPtr<SharedBuffer>* data, bool* allDataReceived)
+static void sharedBufSkDataReleaseProc(const void* addr, void* ctx)
+{
+ RefPtr<SharedBuffer>* pbuffer = static_cast<RefPtr<SharedBuffer>*>(ctx);
+ ASSERT(pbuffer && (*pbuffer)->data() == addr);
+ delete pbuffer;
Stephen White 2015/12/02 02:44:54 It might be clearer to pass a bare pointer though
+}
+
+SkData* ImageFrameGenerator::refSkData()
{
SharedBuffer* buffer = 0;
- m_data.data(&buffer, allDataReceived);
- if (buffer)
- *data = buffer->copy();
+ bool allDataReceived = false;
+ m_data.data(&buffer, &allDataReceived);
chrishtr 2015/12/01 21:56:45 Please change ThreadSafeDataTransport::data to ret
Stephen White 2015/12/02 02:50:39 Even if we fix that, we still need something to pa
aleksandar.stojiljkovic 2015/12/02 11:04:16 Thanks, both chrishtr and you have a point here ab
+ if (!allDataReceived)
+ return nullptr;
+
+ RefPtr<SharedBuffer>* pbuffer = new RefPtr<SharedBuffer>(buffer);
+ return SkData::NewWithProc(buffer->data(), buffer->size(), sharedBufSkDataReleaseProc, pbuffer);
}
bool ImageFrameGenerator::decodeAndScale(const SkImageInfo& info, size_t index, void* pixels, size_t rowBytes)
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698