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

Side by Side Diff: ui/compositor/compositor.h

Issue 2189583004: [not for review - epic CL] Adding Elastic+Momentum+Layered scrolling to views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combined rebase Created 4 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_
6 #define UI_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class LayerTreeHost; 44 class LayerTreeHost;
45 class RendererSettings; 45 class RendererSettings;
46 class SharedBitmapManager; 46 class SharedBitmapManager;
47 class SurfaceIdAllocator; 47 class SurfaceIdAllocator;
48 class SurfaceManager; 48 class SurfaceManager;
49 class TaskGraphRunner; 49 class TaskGraphRunner;
50 } 50 }
51 51
52 namespace gfx { 52 namespace gfx {
53 class Rect; 53 class Rect;
54 class ScrollOffset;
54 class Size; 55 class Size;
55 } 56 }
56 57
57 namespace gpu { 58 namespace gpu {
58 class GpuMemoryBufferManager; 59 class GpuMemoryBufferManager;
59 struct Mailbox; 60 struct Mailbox;
60 } 61 }
61 62
62 namespace ui { 63 namespace ui {
63 64
64 class Compositor; 65 class Compositor;
65 class CompositorVSyncManager; 66 class CompositorVSyncManager;
66 class LatencyInfo; 67 class LatencyInfo;
67 class Layer; 68 class Layer;
68 class Reflector; 69 class Reflector;
70 class UIScrollInputManager;
69 class Texture; 71 class Texture;
70 72
71 const int kCompositorLockTimeoutMs = 67; 73 const int kCompositorLockTimeoutMs = 67;
72 74
73 class COMPOSITOR_EXPORT ContextFactoryObserver { 75 class COMPOSITOR_EXPORT ContextFactoryObserver {
74 public: 76 public:
75 virtual ~ContextFactoryObserver() {} 77 virtual ~ContextFactoryObserver() {}
76 78
77 // Notifies that the ContextProvider returned from 79 // Notifies that the ContextProvider returned from
78 // ui::ContextFactory::SharedMainThreadContextProvider was lost. When this 80 // ui::ContextFactory::SharedMainThreadContextProvider was lost. When this
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Sets the background color used for areas that aren't covered by 261 // Sets the background color used for areas that aren't covered by
260 // the |root_layer|. 262 // the |root_layer|.
261 void SetBackgroundColor(SkColor color); 263 void SetBackgroundColor(SkColor color);
262 264
263 // Sets the visibility of the underlying compositor. 265 // Sets the visibility of the underlying compositor.
264 void SetVisible(bool visible); 266 void SetVisible(bool visible);
265 267
266 // Gets the visibility of the underlying compositor. 268 // Gets the visibility of the underlying compositor.
267 bool IsVisible(); 269 bool IsVisible();
268 270
271 // Gets/Sets the scroll offset for the given layer in step with the
272 // cc::InputHandler.
273 gfx::ScrollOffset GetScrollOffsetForLayer(int layer_id) const;
274 bool ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset);
275
269 // The "authoritative" vsync interval, if provided, will override interval 276 // The "authoritative" vsync interval, if provided, will override interval
270 // reported from 3D context. This is typically the value reported by a more 277 // reported from 3D context. This is typically the value reported by a more
271 // reliable source, e.g, the platform display configuration. 278 // reliable source, e.g, the platform display configuration.
272 // In the particular case of ChromeOS -- this is the value queried through 279 // In the particular case of ChromeOS -- this is the value queried through
273 // XRandR, which is more reliable than the value queried through the 3D 280 // XRandR, which is more reliable than the value queried through the 3D
274 // context. 281 // context.
275 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); 282 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval);
276 283
277 // Sets the widget for the compositor to render into. 284 // Sets the widget for the compositor to render into.
278 void SetAcceleratedWidget(gfx::AcceleratedWidget widget); 285 void SetAcceleratedWidget(gfx::AcceleratedWidget widget);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 const cc::RendererSettings& GetRendererSettings() const; 364 const cc::RendererSettings& GetRendererSettings() const;
358 365
359 LayerAnimatorCollection* layer_animator_collection() { 366 LayerAnimatorCollection* layer_animator_collection() {
360 return &layer_animator_collection_; 367 return &layer_animator_collection_;
361 } 368 }
362 369
363 cc::SurfaceIdAllocator* surface_id_allocator() { 370 cc::SurfaceIdAllocator* surface_id_allocator() {
364 return surface_id_allocator_.get(); 371 return surface_id_allocator_.get();
365 } 372 }
366 373
374 UIScrollInputManager* scroll_input_manager() {
375 return scroll_input_manager_.get();
376 }
377
367 private: 378 private:
368 friend class base::RefCounted<Compositor>; 379 friend class base::RefCounted<Compositor>;
369 friend class CompositorLock; 380 friend class CompositorLock;
370 381
371 // Called by CompositorLock. 382 // Called by CompositorLock.
372 void UnlockCompositor(); 383 void UnlockCompositor();
373 384
374 // Called to release any pending CompositorLock 385 // Called to release any pending CompositorLock
375 void CancelCompositorLock(); 386 void CancelCompositorLock();
376 387
(...skipping 22 matching lines...) Expand all
399 // The device scale factor of the monitor that this compositor is compositing 410 // The device scale factor of the monitor that this compositor is compositing
400 // layers on. 411 // layers on.
401 float device_scale_factor_; 412 float device_scale_factor_;
402 413
403 bool locks_will_time_out_; 414 bool locks_will_time_out_;
404 CompositorLock* compositor_lock_; 415 CompositorLock* compositor_lock_;
405 416
406 LayerAnimatorCollection layer_animator_collection_; 417 LayerAnimatorCollection layer_animator_collection_;
407 scoped_refptr<cc::AnimationTimeline> animation_timeline_; 418 scoped_refptr<cc::AnimationTimeline> animation_timeline_;
408 419
420 std::unique_ptr<UIScrollInputManager> scroll_input_manager_;
421
409 base::WeakPtrFactory<Compositor> weak_ptr_factory_; 422 base::WeakPtrFactory<Compositor> weak_ptr_factory_;
410 423
411 DISALLOW_COPY_AND_ASSIGN(Compositor); 424 DISALLOW_COPY_AND_ASSIGN(Compositor);
412 }; 425 };
413 426
414 } // namespace ui 427 } // namespace ui
415 428
416 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 429 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/compositor.cc » ('j') | ui/events/event_constants.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698