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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1412663005: Introduce painted-device-scale-factor and use it when --enable-use-zoom-for-dsf is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comment Created 5 years, 1 month 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 void RenderWidgetCompositor::detachCompositorAnimationTimeline( 598 void RenderWidgetCompositor::detachCompositorAnimationTimeline(
599 blink::WebCompositorAnimationTimeline* compositor_timeline) { 599 blink::WebCompositorAnimationTimeline* compositor_timeline) {
600 DCHECK(compositor_timeline); 600 DCHECK(compositor_timeline);
601 DCHECK(layer_tree_host_->animation_host()); 601 DCHECK(layer_tree_host_->animation_host());
602 layer_tree_host_->animation_host()->RemoveAnimationTimeline( 602 layer_tree_host_->animation_host()->RemoveAnimationTimeline(
603 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( 603 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>(
604 compositor_timeline)->animation_timeline()); 604 compositor_timeline)->animation_timeline());
605 } 605 }
606 606
607 void RenderWidgetCompositor::setViewportSize( 607 void RenderWidgetCompositor::setViewportSize(
608 const WebSize&,
609 const WebSize& device_viewport_size) {
610 layer_tree_host_->SetViewportSize(device_viewport_size);
611 }
612
613 void RenderWidgetCompositor::setViewportSize(
614 const WebSize& device_viewport_size) { 608 const WebSize& device_viewport_size) {
615 layer_tree_host_->SetViewportSize(device_viewport_size); 609 layer_tree_host_->SetViewportSize(device_viewport_size);
616 } 610 }
617 611
618 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( 612 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom(
619 const WebFloatPoint& point) const { 613 const WebFloatPoint& point) const {
620 return point; 614 return point;
621 } 615 }
622 616
623 void RenderWidgetCompositor::setDeviceScaleFactor(float device_scale) { 617 void RenderWidgetCompositor::setDeviceScaleFactor(float device_scale) {
618 DCHECK(!IsUseZoomForDSFEnabled() || device_scale == 1.f);
624 layer_tree_host_->SetDeviceScaleFactor(device_scale); 619 layer_tree_host_->SetDeviceScaleFactor(device_scale);
625 } 620 }
626 621
627 void RenderWidgetCompositor::setBackgroundColor(blink::WebColor color) { 622 void RenderWidgetCompositor::setBackgroundColor(blink::WebColor color) {
628 layer_tree_host_->set_background_color(color); 623 layer_tree_host_->set_background_color(color);
629 } 624 }
630 625
631 void RenderWidgetCompositor::setHasTransparentBackground(bool transparent) { 626 void RenderWidgetCompositor::setHasTransparentBackground(bool transparent) {
632 layer_tree_host_->set_has_transparent_background(transparent); 627 layer_tree_host_->set_has_transparent_background(transparent);
633 } 628 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 #else 1074 #else
1080 // Ignore what the system said and give all clients the same maximum 1075 // Ignore what the system said and give all clients the same maximum
1081 // allocation on desktop platforms. 1076 // allocation on desktop platforms.
1082 actual.bytes_limit_when_visible = 512 * 1024 * 1024; 1077 actual.bytes_limit_when_visible = 512 * 1024 * 1024;
1083 actual.priority_cutoff_when_visible = 1078 actual.priority_cutoff_when_visible =
1084 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; 1079 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
1085 #endif 1080 #endif
1086 return actual; 1081 return actual;
1087 } 1082 }
1088 1083
1084 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1085 float device_scale) {
1086 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale);
1087 }
1088
1089 } // namespace content 1089 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698