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

Unified Diff: ui/compositor/compositor.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/compositor_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index f0c88887bd3ff29000de140971798002e858e8c6..bc61e1d67dd86cf8b7d446b764309922a00e71f4 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -60,6 +60,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
ui::ContextFactoryPrivate* context_factory_private,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
bool enable_surface_synchronization,
+ bool enable_pixel_canvas,
bool external_begin_frames_enabled)
: context_factory_(context_factory),
context_factory_private_(context_factory_private),
@@ -70,6 +71,7 @@ Compositor::Compositor(const viz::FrameSinkId& frame_sink_id,
layer_animator_collection_(this),
scheduled_timeout_(base::TimeTicks()),
allow_locks_to_extend_timeout_(false),
+ is_pixel_canvas_(enable_pixel_canvas),
weak_ptr_factory_(this),
lock_timeout_weak_ptr_factory_(this) {
if (context_factory_private) {
@@ -334,6 +336,8 @@ void Compositor::SetScaleAndSize(float scale, const gfx::Size& size_in_pixel) {
if (device_scale_factor_ != scale) {
device_scale_factor_ = scale;
host_->SetDeviceScaleFactor(scale);
+ if (is_pixel_canvas())
+ host_->SetRecordingScaleFactor(scale);
if (root_layer_)
root_layer_->OnDeviceScaleFactorChanged(scale);
}
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/compositor_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698