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

Unified Diff: cc/resources/resource_provider.h

Issue 689463003: cc: Move FallbackFence implementation from GLRenderer to ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@one-copy-throttling
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « cc/resources/one_copy_raster_worker_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index c32ec68e6f1c0a0b3ffc8ccbf28dca3b559063ce..adf32f26d75616094f0d7f994f103aec50fc9e3d 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -358,6 +358,29 @@ class CC_EXPORT ResourceProvider {
DISALLOW_COPY_AND_ASSIGN(Fence);
};
+ class SynchronousFence : public ResourceProvider::Fence {
+ public:
+ explicit SynchronousFence(gpu::gles2::GLES2Interface* gl);
+
+ // Overridden from Fence:
+ void Set() override;
+ bool HasPassed() override;
+ void Wait() override;
+
+ // Returns true if fence has been set but not yet synchornized.
+ bool has_synchronized() const { return has_synchronized_; }
+
+ private:
+ ~SynchronousFence() override;
+
+ void Synchronize();
+
+ gpu::gles2::GLES2Interface* gl_;
+ bool has_synchronized_;
+
+ DISALLOW_COPY_AND_ASSIGN(SynchronousFence);
+ };
+
// Acquire pixel buffer for resource. The pixel buffer can be used to
// set resource pixels without performing unnecessary copying.
void AcquirePixelBuffer(ResourceId resource);
@@ -563,6 +586,8 @@ class CC_EXPORT ResourceProvider {
scoped_ptr<IdAllocator> buffer_id_allocator_;
bool use_sync_query_;
+ // Fence used for CopyResource if CHROMIUM_sync_query is not supported.
+ scoped_refptr<SynchronousFence> synchronous_fence_;
DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
};
« no previous file with comments | « cc/resources/one_copy_raster_worker_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698