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

Unified Diff: content/browser/compositor/gpu_browser_compositor_output_surface.cc

Issue 628703005: Remove GpuHostMsg_FrameDrawn and replace with client channel swap ack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/browser/compositor/gpu_browser_compositor_output_surface.cc
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
index efa805261e9d914d261aeaf5d7f46b7119ce8646..23b3308e125e954badafe2d69239e2c1e23d255a 100644
--- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -5,8 +5,11 @@
#include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
#include "cc/output/compositor_frame.h"
+#include "cc/output/output_surface_client.h"
#include "content/browser/compositor/reflector_impl.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
+#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
namespace content {
@@ -35,7 +38,9 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(
CommandBufferProxyImpl* command_buffer_proxy =
provider_command_buffer->GetCommandBufferProxy();
DCHECK(command_buffer_proxy);
- command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info);
+ command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info,
+ base::Bind(&GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted,
+ base::Unretained(this)));
piman 2014/10/07 02:30:39 Because ContextProvider is refcounted, it might ou
no sievers 2014/10/07 19:47:24 Done. I've used CancelableCallback (which essentia
if (reflector_.get()) {
if (frame->gl_frame_data->sub_buffer_rect ==
@@ -45,7 +50,21 @@ void GpuBrowserCompositorOutputSurface::SwapBuffers(
reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect);
}
- OutputSurface::SwapBuffers(frame);
+ if (frame->gl_frame_data->sub_buffer_rect ==
+ gfx::Rect(frame->gl_frame_data->size)) {
+ context_provider_->ContextSupport()->Swap();
+ } else {
+ context_provider_->ContextSupport()->PartialSwapBuffers(
+ frame->gl_frame_data->sub_buffer_rect);
+ }
+
+ client_->DidSwapBuffers();
+}
+
+void GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted(
+ const std::vector<ui::LatencyInfo>& latency_info) {
+ RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
+ BrowserCompositorOutputSurface::OnSwapBuffersComplete();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698