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

Unified Diff: cc/output/output_surface.h

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/managed_memory_policy.cc ('k') | cc/output/output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/output_surface.h
diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h
index d3eca54fa83d98023e0c71e623785a5fd8422d8c..a723645a896159ca5dd40f3a5e0dccc69743dddb 100644
--- a/cc/output/output_surface.h
+++ b/cc/output/output_surface.h
@@ -16,6 +16,8 @@
#include "cc/output/context_provider.h"
#include "cc/output/overlay_candidate_validator.h"
#include "cc/output/software_output_device.h"
+#include "cc/scheduler/frame_source.h"
+#include "ui/compositor/compositor_vsync_manager.h"
namespace base { class SingleThreadTaskRunner; }
@@ -41,7 +43,7 @@ class OutputSurfaceClient;
// From here on, it will only be used on the compositor thread.
// 3. If the 3D context is lost, then the compositor will delete the output
// surface (on the compositor thread) and go back to step 1.
-class CC_EXPORT OutputSurface {
+class CC_EXPORT OutputSurface : public BeginFrameSource {
public:
enum {
DEFAULT_MAX_FRAMES_PENDING = 2
@@ -121,11 +123,6 @@ class CC_EXPORT OutputSurface {
// processing should be stopped, or lowered in priority.
virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {}
- // Requests a BeginFrame notification from the output surface. The
- // notification will be delivered by calling
- // OutputSurfaceClient::BeginFrame until the callback is disabled.
- virtual void SetNeedsBeginFrame(bool enable) {}
-
bool HasClient() { return !!client_; }
// Returns an estimate of the current GPU latency. When only a software
@@ -137,8 +134,22 @@ class CC_EXPORT OutputSurface {
return overlay_candidate_validator_.get();
}
+ void AddVSyncObserver(ui::CompositorVSyncManager::Observer* obs) {
+ vsync_observer_ = obs;
+ };
+
+ // BeginFrameSource
+ virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE;
+ virtual bool NeedsBeginFrames() const OVERRIDE;
+ virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE {}
+ virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+
protected:
+ bool needs_begin_frames_ = false;
+
OutputSurfaceClient* client_;
+ ui::CompositorVSyncManager::Observer* vsync_observer_;
+ BeginFrameObserver* begin_frame_observer_;
// Synchronously initialize context3d and enter hardware mode.
// This can only supported in threaded compositing mode.
« no previous file with comments | « cc/output/managed_memory_policy.cc ('k') | cc/output/output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698