Index: content/browser/renderer_host/compositor_impl_android.cc |
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc |
index e7a1d3c0e05dabd0c8b3fb91ae58e1ee503f867c..dceb9a1845f3e852615b3f3dfdb154373b5062dc 100644 |
--- a/content/browser/renderer_host/compositor_impl_android.cc |
+++ b/content/browser/renderer_host/compositor_impl_android.cc |
@@ -29,6 +29,7 @@ |
#include "content/browser/android/child_process_launcher_android.h" |
#include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
#include "content/browser/gpu/gpu_surface_tracker.h" |
+#include "content/browser/renderer_host/render_widget_host_impl.h" |
#include "content/common/gpu/client/command_buffer_proxy_impl.h" |
#include "content/common/gpu/client/context_provider_command_buffer.h" |
#include "content/common/gpu/client/gl_helper.h" |
@@ -37,6 +38,7 @@ |
#include "content/common/gpu/gpu_process_launch_causes.h" |
#include "content/common/host_shared_bitmap_manager.h" |
#include "content/public/browser/android/compositor_client.h" |
+#include "gpu/command_buffer/client/context_support.h" |
#include "gpu/command_buffer/client/gles2_interface.h" |
#include "third_party/khronos/GLES2/gl2.h" |
#include "third_party/khronos/GLES2/gl2ext.h" |
@@ -77,9 +79,11 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface { |
content::CommandBufferProxyImpl* command_buffer_proxy = |
provider_command_buffer->GetCommandBufferProxy(); |
DCHECK(command_buffer_proxy); |
- command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); |
- |
- OutputSurface::SwapBuffers(frame); |
+ command_buffer_proxy->SetLatencyInfo( |
+ frame->metadata.latency_info, |
+ base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted, |
+ base::Unretained(this))); |
piman
2014/10/07 02:30:39
Same concern here wrt lifetime.
|
+ context_provider_->ContextSupport()->Swap(); |
piman
2014/10/07 02:30:39
nit: add a DCHECK that the frame is a full frame?
no sievers
2014/10/07 19:47:24
Done.
|
} |
virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE { |
@@ -95,6 +99,13 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface { |
return true; |
} |
+ private: |
+ void OnSwapBuffersCompleted( |
+ const std::vector<ui::LatencyInfo>& latency_info) { |
+ RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
+ OutputSurface::OnSwapBuffersComplete(); |
+ } |
+ |
scoped_refptr<base::MessageLoopProxy> main_thread_; |
base::WeakPtr<content::CompositorImpl> compositor_impl_; |
}; |