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

Unified Diff: content/browser/renderer_host/image_transport_factory.cc

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 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
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/content_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/image_transport_factory.cc
diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc
index 412d7c5dec33da1466b3eba977ec562be1b924fb..627d8cd9a407633f1b6ea1ec3bc66395ebac435e 100644
--- a/content/browser/renderer_host/image_transport_factory.cc
+++ b/content/browser/renderer_host/image_transport_factory.cc
@@ -14,6 +14,7 @@
#include "base/observer_list.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/non_thread_safe.h"
+#include "cc/output/compositor_frame.h"
#include "cc/output/output_surface.h"
#include "cc/output/output_surface_client.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
@@ -539,35 +540,25 @@ class BrowserCompositorOutputSurface
reflector_->OnReshape(size);
}
- virtual void SwapBuffers(const ui::LatencyInfo& latency_info) OVERRIDE {
- WebGraphicsContext3DCommandBufferImpl* command_buffer =
- static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d());
- CommandBufferProxyImpl* command_buffer_proxy =
- command_buffer->GetCommandBufferProxy();
- DCHECK(command_buffer_proxy);
- context3d()->shallowFlushCHROMIUM();
- command_buffer_proxy->SetLatencyInfo(latency_info);
+ virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE {
+ DCHECK(frame->gl_frame_data);
- if (reflector_.get())
- reflector_->OnSwapBuffers();
-
- OutputSurface::SwapBuffers(latency_info);
- }
-
- virtual void PostSubBuffer(gfx::Rect rect,
- const ui::LatencyInfo& latency_info) OVERRIDE {
WebGraphicsContext3DCommandBufferImpl* command_buffer =
static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d());
CommandBufferProxyImpl* command_buffer_proxy =
command_buffer->GetCommandBufferProxy();
DCHECK(command_buffer_proxy);
context3d()->shallowFlushCHROMIUM();
- command_buffer_proxy->SetLatencyInfo(latency_info);
+ command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info);
- if (reflector_.get())
- reflector_->OnPostSubBuffer(rect);
+ if (reflector_.get()) {
+ if (frame->gl_frame_data->partial_swap_allowed)
+ reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect);
+ else
+ reflector_->OnSwapBuffers();
+ }
- OutputSurface::PostSubBuffer(rect, latency_info);
+ OutputSurface::SwapBuffers(frame);
}
void SetReflector(ReflectorImpl* reflector) {
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698