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

Unified Diff: cc/trees/layer_tree_host_impl.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 157fe00eb67013347d1840a7c9499e392b885fcf..24cb7301526522ff9f4e1f4bda9a6c0f18f4b42f 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -31,7 +31,6 @@
#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"
@@ -45,7 +44,6 @@ class DebugRectHistory;
class EvictionTilePriorityQueue;
class FrameRateCounter;
class LayerImpl;
-class LayerTreeHostImplTimeSourceAdapter;
class LayerTreeImpl;
class MemoryHistory;
class PageScaleAnimation;
@@ -56,6 +54,7 @@ class RasterWorkerPool;
class RenderPassDrawQuad;
class RenderingStatsInstrumentation;
class ResourcePool;
+class ScrollElasticityHelper;
class ScrollbarLayerImplBase;
class TextureMailboxDeleter;
class TopControlsManager;
@@ -76,6 +75,7 @@ class LayerTreeHostImplClient {
virtual void DidSwapBuffersCompleteOnImplThread() = 0;
virtual void OnCanDrawStateChanged(bool can_draw) = 0;
virtual void NotifyReadyToActivate() = 0;
+ virtual void NotifyReadyToDraw() = 0;
// Please call these 3 functions through
// LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and
// SetNeedsAnimate().
@@ -112,7 +112,6 @@ class CC_EXPORT LayerTreeHostImpl
public OutputSurfaceClient,
public TopControlsManagerClient,
public ScrollbarAnimationControllerClient,
- public BeginFrameSourceMixIn,
public base::SupportsWeakPtr<LayerTreeHostImpl> {
public:
static scoped_ptr<LayerTreeHostImpl> Create(
@@ -125,9 +124,6 @@ class CC_EXPORT LayerTreeHostImpl
int id);
~LayerTreeHostImpl() override;
- // BeginFrameSourceMixIn implementation
- void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
-
// InputHandler implementation
void BindToClient(InputHandlerClient* client) override;
InputHandler::ScrollStatus ScrollBegin(
@@ -136,8 +132,9 @@ class CC_EXPORT LayerTreeHostImpl
InputHandler::ScrollStatus ScrollAnimated(
const gfx::Point& viewport_point,
const gfx::Vector2dF& scroll_delta) override;
- bool ScrollBy(const gfx::Point& viewport_point,
- const gfx::Vector2dF& scroll_delta) override;
+ InputHandlerScrollResult ScrollBy(
+ const gfx::Point& viewport_point,
+ const gfx::Vector2dF& scroll_delta) override;
bool ScrollVerticallyByPage(const gfx::Point& viewport_point,
ScrollDirection direction) override;
void SetRootLayerScrollOffsetDelegate(
@@ -156,6 +153,7 @@ class CC_EXPORT LayerTreeHostImpl
bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override;
scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
ui::LatencyInfo* latency) override;
+ ScrollElasticityHelper* CreateScrollElasticityHelper() override;
// TopControlsManagerClient implementation.
void SetControlsTopOffset(float offset) override;
@@ -188,7 +186,6 @@ class CC_EXPORT LayerTreeHostImpl
virtual void UpdateAnimationState(bool start_ready_animations);
void ActivateAnimations();
void MainThreadHasStoppedFlinging();
- void UpdateBackgroundAnimateTicking(bool should_background_tick);
void DidAnimateScrollOffset();
void SetViewportDamage(const gfx::Rect& damage_rect);
@@ -234,6 +231,7 @@ class CC_EXPORT LayerTreeHostImpl
// TileManagerClient implementation.
const std::vector<PictureLayerImpl*>& GetPictureLayers() const override;
void NotifyReadyToActivate() override;
+ void NotifyReadyToDraw() override;
void NotifyTileStateChanged(const Tile* tile) override;
void BuildRasterQueue(RasterTilePriorityQueue* queue,
TreePriority tree_priority) override;
@@ -251,8 +249,6 @@ class CC_EXPORT LayerTreeHostImpl
void CommitVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) override;
void SetNeedsRedrawRect(const gfx::Rect& rect) override;
- void BeginFrame(const BeginFrameArgs& args) override;
-
void SetExternalDrawConstraints(
const gfx::Transform& transform,
const gfx::Rect& viewport,
@@ -329,6 +325,8 @@ class CC_EXPORT LayerTreeHostImpl
virtual void SetVisible(bool visible);
bool visible() const { return visible_; }
+ bool AnimationsAreVisible() { return visible() && CanDraw(); }
+
void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); }
void SetNeedsRedraw();
@@ -424,7 +422,7 @@ class CC_EXPORT LayerTreeHostImpl
return begin_impl_frame_interval_;
}
- void AsValueInto(base::debug::TracedValue* value) const override;
+ void AsValueInto(base::debug::TracedValue* value) const;
void AsValueWithFrameInto(FrameData* frame,
base::debug::TracedValue* value) const;
scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
@@ -473,8 +471,8 @@ class CC_EXPORT LayerTreeHostImpl
void RegisterPictureLayerImpl(PictureLayerImpl* layer);
void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
- void GetPictureLayerImplPairs(
- std::vector<PictureLayerImpl::Pair>* layers) const;
+ void GetPictureLayerImplPairs(std::vector<PictureLayerImpl::Pair>* layers,
+ bool need_valid_tile_priorities) const;
void SetTopControlsLayoutHeight(float height);
@@ -506,8 +504,6 @@ class CC_EXPORT LayerTreeHostImpl
// Virtual for testing.
virtual void AnimateLayers(base::TimeTicks monotonic_time);
- virtual base::TimeDelta LowFrequencyAnimationInterval() const;
-
const AnimationRegistrar::AnimationControllerMap&
active_animation_controllers() const {
return animation_registrar_->active_animation_controllers();
@@ -627,6 +623,10 @@ class CC_EXPORT LayerTreeHostImpl
int scroll_layer_id_when_mouse_over_scrollbar_;
ScopedPtrVector<SwapPromise> swap_promises_for_main_thread_scroll_update_;
+ // An object to implement the ScrollElasticityHelper interface and
+ // hold all state related to elasticity. May be NULL if never requested.
+ scoped_ptr<ScrollElasticityHelper> scroll_elasticity_helper_;
+
bool tile_priorities_dirty_;
// The optional delegate for the root layer scroll offset.
@@ -646,9 +646,6 @@ class CC_EXPORT LayerTreeHostImpl
scoped_ptr<PageScaleAnimation> page_scale_animation_;
- // This is used for ticking animations slowly when hidden.
- scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_;
-
scoped_ptr<FrameRateCounter> fps_counter_;
scoped_ptr<PaintTimeCounter> paint_time_counter_;
scoped_ptr<MemoryHistory> memory_history_;
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698