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

Unified Diff: cc/raster/one_copy_raster_buffer_provider.cc

Issue 2555743004: Delay activation/draw on GPU tile work completion (Closed)
Patch Set: cleanup Created 4 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: cc/raster/one_copy_raster_buffer_provider.cc
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc
index 8b5acfc114f74491cced19aba7d862fbf9f9132b..10ac14ce446fce5494788129a877f3871c481d27 100644
--- a/cc/raster/one_copy_raster_buffer_provider.cc
+++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -20,6 +20,7 @@
#include "cc/resources/resource_util.h"
#include "cc/resources/scoped_resource.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "ui/gfx/buffer_format_util.h"
@@ -161,6 +162,26 @@ bool OneCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() const {
return false;
}
+uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback(
+ const ResourceProvider::ResourceIdArray& resource_ids,
+ const base::Callback<void(uint64_t)>& callback,
+ uint64_t pending_callback_id) const {
+ if (!async_worker_context_enabled_)
+ return 0;
+
+ gpu::SyncToken sync_token =
+ resource_provider_->GetSyncTokenForResources(resource_ids);
+ uint64_t callback_id = sync_token.release_count();
+ DCHECK_NE(callback_id, 0u);
+
+ if (callback_id != pending_callback_id) {
vmpstr 2016/12/07 21:00:25 Can you add a comment explaining what's going on h
+ compositor_context_provider_->ContextSupport()->SignalSyncToken(
+ sync_token, base::Bind(callback, callback_id));
+ }
+
+ return callback_id;
+}
+
void OneCopyRasterBufferProvider::Shutdown() {
staging_pool_.Shutdown();
pending_raster_buffers_.clear();

Powered by Google App Engine
This is Rietveld 408576698