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

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 986443003: Move viewport scrolling logic into separate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class TileTaskWorkerPool; 56 class TileTaskWorkerPool;
57 class RenderPassDrawQuad; 57 class RenderPassDrawQuad;
58 class RenderingStatsInstrumentation; 58 class RenderingStatsInstrumentation;
59 class ResourcePool; 59 class ResourcePool;
60 class ScrollElasticityHelper; 60 class ScrollElasticityHelper;
61 class ScrollbarLayerImplBase; 61 class ScrollbarLayerImplBase;
62 class TextureMailboxDeleter; 62 class TextureMailboxDeleter;
63 class TopControlsManager; 63 class TopControlsManager;
64 class UIResourceBitmap; 64 class UIResourceBitmap;
65 class UIResourceRequest; 65 class UIResourceRequest;
66 class Viewport;
66 struct RendererCapabilitiesImpl; 67 struct RendererCapabilitiesImpl;
67 68
68 enum class GpuRasterizationStatus { 69 enum class GpuRasterizationStatus {
69 ON, 70 ON,
70 ON_FORCED, 71 ON_FORCED,
71 OFF_DEVICE, 72 OFF_DEVICE,
72 OFF_VIEWPORT, 73 OFF_VIEWPORT,
73 OFF_CONTENT 74 OFF_CONTENT
74 }; 75 };
75 76
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, 516 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool,
516 scoped_ptr<ResourcePool>* resource_pool, 517 scoped_ptr<ResourcePool>* resource_pool,
517 scoped_ptr<ResourcePool>* staging_resource_pool); 518 scoped_ptr<ResourcePool>* staging_resource_pool);
518 519
519 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } 520 bool prepare_tiles_needed() const { return tile_priorities_dirty_; }
520 521
521 FrameTimingTracker* frame_timing_tracker() { 522 FrameTimingTracker* frame_timing_tracker() {
522 return frame_timing_tracker_.get(); 523 return frame_timing_tracker_.get();
523 } 524 }
524 525
526 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta(
527 LayerImpl* layer_impl,
528 const gfx::PointF& viewport_point,
529 const gfx::Vector2dF& viewport_delta);
530 gfx::Vector2dF ScrollLayerWithLocalDelta(
531 LayerImpl* layer_impl,
532 const gfx::Vector2dF& local_delta,
533 float page_scale_factor) const;
534
525 protected: 535 protected:
526 LayerTreeHostImpl( 536 LayerTreeHostImpl(
527 const LayerTreeSettings& settings, 537 const LayerTreeSettings& settings,
528 LayerTreeHostImplClient* client, 538 LayerTreeHostImplClient* client,
529 Proxy* proxy, 539 Proxy* proxy,
530 RenderingStatsInstrumentation* rendering_stats_instrumentation, 540 RenderingStatsInstrumentation* rendering_stats_instrumentation,
531 SharedBitmapManager* shared_bitmap_manager, 541 SharedBitmapManager* shared_bitmap_manager,
532 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 542 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
533 int id); 543 int id);
534 544
535 545
536 // Virtual for testing. 546 // Virtual for testing.
537 virtual void AnimateLayers(base::TimeTicks monotonic_time); 547 virtual void AnimateLayers(base::TimeTicks monotonic_time);
538 548
539 LayerTreeHostImplClient* client_; 549 LayerTreeHostImplClient* client_;
540 Proxy* proxy_; 550 Proxy* proxy_;
541 551
542 private: 552 private:
543 void CreateAndSetRenderer(); 553 void CreateAndSetRenderer();
544 void CreateAndSetTileManager(); 554 void CreateAndSetTileManager();
545 void DestroyTileManager(); 555 void DestroyTileManager();
546 void ReleaseTreeResources(); 556 void ReleaseTreeResources();
547 void RecreateTreeResources(); 557 void RecreateTreeResources();
548 void EnforceZeroBudget(bool zero_budget); 558 void EnforceZeroBudget(bool zero_budget);
549 559
550 bool IsSynchronousSingleThreaded() const; 560 bool IsSynchronousSingleThreaded() const;
551 561
562 Viewport* Viewport();
563
552 // Scroll by preferring to move the outer viewport first, only moving the 564 // Scroll by preferring to move the outer viewport first, only moving the
553 // inner if the outer is at its scroll extents. 565 // inner if the outer is at its scroll extents.
554 void ScrollViewportBy(gfx::Vector2dF scroll_delta); 566 void ScrollViewportBy(gfx::Vector2dF scroll_delta);
555 // Scroll by preferring to move the inner viewport first, only moving the 567 // Scroll by preferring to move the inner viewport first, only moving the
556 // outer if the inner is at its scroll extents. 568 // outer if the inner is at its scroll extents.
557 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); 569 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta);
558 void AnimatePageScale(base::TimeTicks monotonic_time); 570 void AnimatePageScale(base::TimeTicks monotonic_time);
559 void AnimateScrollbars(base::TimeTicks monotonic_time); 571 void AnimateScrollbars(base::TimeTicks monotonic_time);
560 void AnimateTopControls(base::TimeTicks monotonic_time); 572 void AnimateTopControls(base::TimeTicks monotonic_time);
561 573
562 bool ShouldTopControlsConsumeScroll(const gfx::Vector2dF& scroll_delta) const;
563
564 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta(
565 LayerImpl* layer_impl,
566 float scale_from_viewport_to_screen_space,
567 const gfx::PointF& viewport_point,
568 const gfx::Vector2dF& viewport_delta);
569
570 void TrackDamageForAllSurfaces( 574 void TrackDamageForAllSurfaces(
571 LayerImpl* root_draw_layer, 575 LayerImpl* root_draw_layer,
572 const LayerImplList& render_surface_layer_list); 576 const LayerImplList& render_surface_layer_list);
573 577
574 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); 578 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy);
575 579
576 // This function should only be called from PrepareToDraw, as DidDrawAllLayers 580 // This function should only be called from PrepareToDraw, as DidDrawAllLayers
577 // must be called if this helper function is called. Returns DRAW_SUCCESS if 581 // must be called if this helper function is called. Returns DRAW_SUCCESS if
578 // the frame should be drawn. 582 // the frame should be drawn.
579 DrawResult CalculateRenderPasses(FrameData* frame); 583 DrawResult CalculateRenderPasses(FrameData* frame);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 bool is_likely_to_require_a_draw_; 736 bool is_likely_to_require_a_draw_;
733 737
734 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; 738 scoped_ptr<FrameTimingTracker> frame_timing_tracker_;
735 739
736 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 740 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
737 }; 741 };
738 742
739 } // namespace cc 743 } // namespace cc
740 744
741 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 745 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698