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

Unified Diff: cc/output/output_surface.cc

Issue 577643002: Making OutputSurface a begin frame source and vsync source. (Closed)
Patch Set: Created 6 years, 3 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 | « cc/output/output_surface.h ('k') | cc/output/output_surface_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/output_surface.cc
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 27b3fbddfc2c6997cace8420531e0d158135d15a..dfb8047f9ba23db7d21ce5d5b8d7ff017b1dee7f 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/debug/trace_event.h"
+#include "base/debug/trace_event_argument.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
@@ -43,6 +44,8 @@ namespace cc {
OutputSurface::OutputSurface(
const scoped_refptr<ContextProvider>& context_provider)
: client_(NULL),
+ vsync_observer_(NULL),
+ begin_frame_observer_(NULL),
context_provider_(context_provider),
device_scale_factor_(-1),
external_stencil_test_enabled_(false),
@@ -52,6 +55,8 @@ OutputSurface::OutputSurface(
OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device)
: client_(NULL),
+ vsync_observer_(NULL),
+ begin_frame_observer_(NULL),
software_device_(software_device.Pass()),
device_scale_factor_(-1),
external_stencil_test_enabled_(false),
@@ -63,6 +68,8 @@ OutputSurface::OutputSurface(
const scoped_refptr<ContextProvider>& context_provider,
scoped_ptr<SoftwareOutputDevice> software_device)
: client_(NULL),
+ vsync_observer_(NULL),
+ begin_frame_observer_(NULL),
context_provider_(context_provider),
software_device_(software_device.Pass()),
device_scale_factor_(-1),
@@ -79,7 +86,18 @@ void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase,
(timebase - base::TimeTicks()).InSecondsF(),
"interval",
interval.InSecondsF());
- client_->CommitVSyncParameters(timebase, interval);
+ if (vsync_observer_)
+ vsync_observer_->OnUpdateVSyncParameters(timebase, interval);
+}
+
+void OutputSurface::SetNeedsBeginFrames(bool needs_begin_frames) {
+ needs_begin_frames_ = needs_begin_frames;
+}
+bool OutputSurface::NeedsBeginFrames() const {
+ return needs_begin_frames_;
+}
+void OutputSurface::AsValueInto(base::debug::TracedValue* dict) const {
+ dict->SetString("type", "OutputSurface");
}
// Forwarded to OutputSurfaceClient
« no previous file with comments | « cc/output/output_surface.h ('k') | cc/output/output_surface_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698