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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: 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
« no previous file with comments | « ui/compositor/canvas_painter.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient), 187 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient),
188 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient), 188 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient),
189 NON_EXPORTED_BASE(public CompositorLockDelegate), 189 NON_EXPORTED_BASE(public CompositorLockDelegate),
190 NON_EXPORTED_BASE(public viz::HostFrameSinkClient) { 190 NON_EXPORTED_BASE(public viz::HostFrameSinkClient) {
191 public: 191 public:
192 Compositor(const viz::FrameSinkId& frame_sink_id, 192 Compositor(const viz::FrameSinkId& frame_sink_id,
193 ui::ContextFactory* context_factory, 193 ui::ContextFactory* context_factory,
194 ui::ContextFactoryPrivate* context_factory_private, 194 ui::ContextFactoryPrivate* context_factory_private,
195 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 195 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
196 bool enable_surface_synchronization, 196 bool enable_surface_synchronization,
197 bool enable_pixel_canvas,
197 bool external_begin_frames_enabled = false); 198 bool external_begin_frames_enabled = false);
198 ~Compositor() override; 199 ~Compositor() override;
199 200
200 ui::ContextFactory* context_factory() { return context_factory_; } 201 ui::ContextFactory* context_factory() { return context_factory_; }
201 202
202 ui::ContextFactoryPrivate* context_factory_private() { 203 ui::ContextFactoryPrivate* context_factory_private() {
203 return context_factory_private_; 204 return context_factory_private_;
204 } 205 }
205 206
206 void AddFrameSink(const viz::FrameSinkId& frame_sink_id); 207 void AddFrameSink(const viz::FrameSinkId& frame_sink_id);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 399 }
399 400
400 const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 401 const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
401 int activated_frame_count() const { return activated_frame_count_; } 402 int activated_frame_count() const { return activated_frame_count_; }
402 float refresh_rate() const { return refresh_rate_; } 403 float refresh_rate() const { return refresh_rate_; }
403 404
404 void set_allow_locks_to_extend_timeout(bool allowed) { 405 void set_allow_locks_to_extend_timeout(bool allowed) {
405 allow_locks_to_extend_timeout_ = allowed; 406 allow_locks_to_extend_timeout_ = allowed;
406 } 407 }
407 408
409 // If true, all paint commands are recorded at pixel size instead of DIP.
410 bool is_pixel_canvas() const { return is_pixel_canvas_; }
411
408 private: 412 private:
409 friend class base::RefCounted<Compositor>; 413 friend class base::RefCounted<Compositor>;
410 414
411 // CompositorLockDelegate implementation. 415 // CompositorLockDelegate implementation.
412 void RemoveCompositorLock(CompositorLock* lock) override; 416 void RemoveCompositorLock(CompositorLock* lock) override;
413 417
414 // Causes all active CompositorLocks to be timed out. 418 // Causes all active CompositorLocks to be timed out.
415 void TimeoutLocks(); 419 void TimeoutLocks();
416 420
417 gfx::Size size_; 421 gfx::Size size_;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 scoped_refptr<cc::AnimationTimeline> animation_timeline_; 466 scoped_refptr<cc::AnimationTimeline> animation_timeline_;
463 std::unique_ptr<ScopedAnimationDurationScaleMode> slow_animations_; 467 std::unique_ptr<ScopedAnimationDurationScaleMode> slow_animations_;
464 468
465 gfx::ColorSpace output_color_space_; 469 gfx::ColorSpace output_color_space_;
466 gfx::ColorSpace blending_color_space_; 470 gfx::ColorSpace blending_color_space_;
467 471
468 // The estimated time that the locks will timeout. 472 // The estimated time that the locks will timeout.
469 base::TimeTicks scheduled_timeout_; 473 base::TimeTicks scheduled_timeout_;
470 // If true, the |scheduled_timeout_| might be recalculated and extended. 474 // If true, the |scheduled_timeout_| might be recalculated and extended.
471 bool allow_locks_to_extend_timeout_; 475 bool allow_locks_to_extend_timeout_;
476 // If true, all paint commands are recorded at pixel size instead of DIP.
477 const bool is_pixel_canvas_;
472 478
473 base::WeakPtrFactory<Compositor> weak_ptr_factory_; 479 base::WeakPtrFactory<Compositor> weak_ptr_factory_;
474 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_; 480 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_;
475 481
476 DISALLOW_COPY_AND_ASSIGN(Compositor); 482 DISALLOW_COPY_AND_ASSIGN(Compositor);
477 }; 483 };
478 484
479 } // namespace ui 485 } // namespace ui
480 486
481 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 487 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « ui/compositor/canvas_painter.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698