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

Unified Diff: content/browser/aura/browser_compositor_output_surface.cc

Issue 57883007: Adding support for VSyncProvider to the software drawing path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use BrowserCompositorOutputSurface as base class Created 7 years, 1 month 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/aura/browser_compositor_output_surface.cc
diff --git a/content/browser/aura/browser_compositor_output_surface.cc b/content/browser/aura/browser_compositor_output_surface.cc
index 7a60b86dd13dc149e37904ae1c7da999774f3b22..1656991fb6b2744e0e93ba569f35cb74dcf34c4a 100644
--- a/content/browser/aura/browser_compositor_output_surface.cc
+++ b/content/browser/aura/browser_compositor_output_surface.cc
@@ -9,10 +9,8 @@
#include "base/location.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/strings/string_number_conversions.h"
-#include "cc/output/compositor_frame.h"
#include "content/browser/aura/reflector_impl.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
-#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_switches.h"
@@ -40,7 +38,30 @@ BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending;
}
capabilities_.adjust_deadline_for_parent = false;
piman 2013/11/07 00:45:12 nit: Can we share this code between the 2 construc
dnicoara 2013/11/07 15:17:41 Done.
- DetachFromThread();
+}
+
+BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
+ scoped_ptr<cc::SoftwareOutputDevice> software_device,
+ int surface_id,
+ IDMap<BrowserCompositorOutputSurface>* output_surface_map,
+ base::MessageLoopProxy* compositor_message_loop,
+ base::WeakPtr<ui::Compositor> compositor)
+ : OutputSurface(software_device.Pass()),
+ surface_id_(surface_id),
+ output_surface_map_(output_surface_map),
+ compositor_message_loop_(compositor_message_loop),
+ compositor_(compositor) {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kUIMaxFramesPending)) {
+ std::string string_value =
+ command_line->GetSwitchValueASCII(switches::kUIMaxFramesPending);
+ int int_value;
+ if (base::StringToInt(string_value, &int_value))
+ capabilities_.max_frames_pending = int_value;
+ else
+ LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending;
+ }
+ capabilities_.adjust_deadline_for_parent = false;
}
BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() {
@@ -70,29 +91,6 @@ void BrowserCompositorOutputSurface::Reshape(gfx::Size size,
reflector_->OnReshape(size);
}
-void BrowserCompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
- DCHECK(frame->gl_frame_data);
-
- WebGraphicsContext3DCommandBufferImpl* command_buffer_context =
- static_cast<WebGraphicsContext3DCommandBufferImpl*>(
- context_provider_->Context3d());
- CommandBufferProxyImpl* command_buffer_proxy =
- command_buffer_context->GetCommandBufferProxy();
- DCHECK(command_buffer_proxy);
- context_provider_->Context3d()->shallowFlushCHROMIUM();
- command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info);
-
- if (reflector_.get()) {
- if (frame->gl_frame_data->sub_buffer_rect ==
- gfx::Rect(frame->gl_frame_data->size))
- reflector_->OnSwapBuffers();
- else
- reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect);
- }
-
- OutputSurface::SwapBuffers(frame);
-}
-
void BrowserCompositorOutputSurface::OnUpdateVSyncParameters(
base::TimeTicks timebase,
base::TimeDelta interval) {

Powered by Google App Engine
This is Rietveld 408576698