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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Fix applist_unittest and sync with ToT Created 3 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // view hierarchy. 181 // view hierarchy.
182 class COMPOSITOR_EXPORT Compositor 182 class COMPOSITOR_EXPORT Compositor
183 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient), 183 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient),
184 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient), 184 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient),
185 NON_EXPORTED_BASE(public CompositorLockDelegate) { 185 NON_EXPORTED_BASE(public CompositorLockDelegate) {
186 public: 186 public:
187 Compositor(const viz::FrameSinkId& frame_sink_id, 187 Compositor(const viz::FrameSinkId& frame_sink_id,
188 ui::ContextFactory* context_factory, 188 ui::ContextFactory* context_factory,
189 ui::ContextFactoryPrivate* context_factory_private, 189 ui::ContextFactoryPrivate* context_factory_private,
190 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 190 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
191 bool enable_surface_synchronization); 191 bool enable_surface_synchronization,
192 bool enable_pixel_canvas);
192 ~Compositor() override; 193 ~Compositor() override;
193 194
194 ui::ContextFactory* context_factory() { return context_factory_; } 195 ui::ContextFactory* context_factory() { return context_factory_; }
195 196
196 ui::ContextFactoryPrivate* context_factory_private() { 197 ui::ContextFactoryPrivate* context_factory_private() {
197 return context_factory_private_; 198 return context_factory_private_;
198 } 199 }
199 200
200 void AddFrameSink(const viz::FrameSinkId& frame_sink_id); 201 void AddFrameSink(const viz::FrameSinkId& frame_sink_id);
201 void RemoveFrameSink(const viz::FrameSinkId& frame_sink_id); 202 void RemoveFrameSink(const viz::FrameSinkId& frame_sink_id);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 372 }
372 373
373 const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 374 const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
374 int activated_frame_count() const { return activated_frame_count_; } 375 int activated_frame_count() const { return activated_frame_count_; }
375 float refresh_rate() const { return refresh_rate_; } 376 float refresh_rate() const { return refresh_rate_; }
376 377
377 void set_allow_locks_to_extend_timeout(bool allowed) { 378 void set_allow_locks_to_extend_timeout(bool allowed) {
378 allow_locks_to_extend_timeout_ = allowed; 379 allow_locks_to_extend_timeout_ = allowed;
379 } 380 }
380 381
382 // If true, all paint commands are recorded at pixel size instead of DIP.
383 bool is_pixel_canvas() const { return is_pixel_canvas_; }
384
381 private: 385 private:
382 friend class base::RefCounted<Compositor>; 386 friend class base::RefCounted<Compositor>;
383 387
384 // CompositorLockDelegate implementation. 388 // CompositorLockDelegate implementation.
385 void RemoveCompositorLock(CompositorLock* lock) override; 389 void RemoveCompositorLock(CompositorLock* lock) override;
386 390
387 // Causes all active CompositorLocks to be timed out. 391 // Causes all active CompositorLocks to be timed out.
388 void TimeoutLocks(); 392 void TimeoutLocks();
389 393
390 gfx::Size size_; 394 gfx::Size size_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 scoped_refptr<cc::AnimationTimeline> animation_timeline_; 435 scoped_refptr<cc::AnimationTimeline> animation_timeline_;
432 std::unique_ptr<ScopedAnimationDurationScaleMode> slow_animations_; 436 std::unique_ptr<ScopedAnimationDurationScaleMode> slow_animations_;
433 437
434 gfx::ColorSpace output_color_space_; 438 gfx::ColorSpace output_color_space_;
435 gfx::ColorSpace blending_color_space_; 439 gfx::ColorSpace blending_color_space_;
436 440
437 // The estimated time that the locks will timeout. 441 // The estimated time that the locks will timeout.
438 base::TimeTicks scheduled_timeout_; 442 base::TimeTicks scheduled_timeout_;
439 // If true, the |scheduled_timeout_| might be recalculated and extended. 443 // If true, the |scheduled_timeout_| might be recalculated and extended.
440 bool allow_locks_to_extend_timeout_; 444 bool allow_locks_to_extend_timeout_;
445 // If true, all paint commands are recorded at pixel size instead of DIP.
446 const bool is_pixel_canvas_;
441 447
442 base::WeakPtrFactory<Compositor> weak_ptr_factory_; 448 base::WeakPtrFactory<Compositor> weak_ptr_factory_;
443 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_; 449 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_;
444 450
445 DISALLOW_COPY_AND_ASSIGN(Compositor); 451 DISALLOW_COPY_AND_ASSIGN(Compositor);
446 }; 452 };
447 453
448 } // namespace ui 454 } // namespace ui
449 455
450 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 456 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698