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

Unified Diff: cc/resources/resource_provider.h

Issue 1157943004: cc: [WIP] Use worker context and OrderingBarrierCHROMIUM for one-copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle sync while copying texture. Created 5 years, 6 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: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 2130bb7b1a983b19cfc9342aedcc5b75a66617f7..ccef1cd50389b7e7e7a0f40ebb3c2b8d883b379b 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -399,6 +399,29 @@ class CC_EXPORT ResourceProvider {
DISALLOW_COPY_AND_ASSIGN(SynchronousFence);
};
+ // Query object based fence implementation used to detect completion of copy
+ // texture operations. Fence has passed when query result is available.
+ class CopyTextureFence : public ResourceProvider::Fence {
+ public:
+ CopyTextureFence(gpu::gles2::GLES2Interface* gl, unsigned query_id)
+ : gl_(gl), query_id_(query_id) {}
+
+ // Overridden from ResourceProvider::Fence:
+ void Set() override {}
+ bool HasPassed() override;
+ void Wait() override;
+
+ private:
+ ~CopyTextureFence() override {}
+
+ void ProcessResult();
+
+ gpu::gles2::GLES2Interface* gl_;
+ unsigned query_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(CopyTextureFence);
+ };
+
// Acquire pixel buffer for resource. The pixel buffer can be used to
// set resource pixels without performing unnecessary copying.
void AcquirePixelBuffer(ResourceId resource);

Powered by Google App Engine
This is Rietveld 408576698