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

Unified Diff: cc/trees/layer_tree_host_impl.h

Issue 267783004: Refactoring the way begin frame sources inside scheduler work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trying an alternative to OnMissedBeginFrames method. 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
Index: cc/trees/layer_tree_host_impl.h
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index a7a0e30317acdec58888d71e32c66fc612173b0f..ef3660e5afc3d50f0c3fa07dbe6af21c5d806576 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -31,6 +31,7 @@
#include "cc/quads/render_pass.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/tile_manager.h"
+#include "cc/scheduler/begin_frame_source.h"
#include "cc/scheduler/draw_result.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -73,7 +74,6 @@ class LayerTreeHostImplClient {
virtual void SetMaxSwapsPendingOnImplThread(int max) = 0;
virtual void DidSwapBuffersOnImplThread() = 0;
virtual void DidSwapBuffersCompleteOnImplThread() = 0;
- virtual void BeginFrame(const BeginFrameArgs& args) = 0;
virtual void OnCanDrawStateChanged(bool can_draw) = 0;
virtual void NotifyReadyToActivate() = 0;
// Please call these 3 functions through
@@ -112,6 +112,7 @@ class CC_EXPORT LayerTreeHostImpl
public OutputSurfaceClient,
public TopControlsManagerClient,
public ScrollbarAnimationControllerClient,
+ public BeginFrameSource,
public base::SupportsWeakPtr<LayerTreeHostImpl> {
public:
static scoped_ptr<LayerTreeHostImpl> Create(
@@ -123,6 +124,11 @@ class CC_EXPORT LayerTreeHostImpl
int id);
virtual ~LayerTreeHostImpl();
+ // BeginFrameSource implementation
+ virtual bool NeedsBeginFrames() const OVERRIDE;
+ virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE;
+ virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE{};
+
// InputHandler implementation
virtual void BindToClient(InputHandlerClient* client) OVERRIDE;
virtual InputHandler::ScrollStatus ScrollBegin(
@@ -296,7 +302,6 @@ class CC_EXPORT LayerTreeHostImpl
const RendererCapabilitiesImpl& GetRendererCapabilities() const;
virtual bool SwapBuffers(const FrameData& frame);
- void SetNeedsBeginFrame(bool enable);
virtual void WillBeginImplFrame(const BeginFrameArgs& args);
void DidModifyTilePriorities();
@@ -428,9 +433,7 @@ class CC_EXPORT LayerTreeHostImpl
return begin_impl_frame_interval_;
}
- void AsValueInto(base::debug::TracedValue* value) const {
- return AsValueWithFrameInto(NULL, value);
- }
+ virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE;
void AsValueWithFrameInto(FrameData* frame,
base::debug::TracedValue* value) const;
scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
@@ -510,6 +513,7 @@ class CC_EXPORT LayerTreeHostImpl
LayerTreeHostImplClient* client_;
Proxy* proxy_;
+ bool needs_begin_frames_;
private:
void CreateAndSetRenderer();

Powered by Google App Engine
This is Rietveld 408576698