Commit 5808937b authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Specify fullscreen ppapi root layer bounds in pixels

Note from the comments in cc::Layer that the bounds of root cc::Layers
are specified in pixels, in contrast with those of non-root cc::Layers,
which are specified in DIPs.

Add a compositor_viewport_pixel_size() accessor to RenderWidget to
access this from the sub-class (naming is due the pending renaming of
physical_backing_size to compositor_viewport_pixel_size).

Bug: 814690
Change-Id: Ia8033961e04f18c374123b4f9f8da96be131edc7
Reviewed-on: https://chromium-review.googlesource.com/954359Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541923}
parent e3e4f646
......@@ -190,6 +190,9 @@ class CONTENT_EXPORT RenderWidget
blink::WebInputMethodController* GetInputMethodController() const;
const gfx::Size& size() const { return size_; }
const gfx::Size& compositor_viewport_pixel_size() const {
return physical_backing_size_;
}
bool is_fullscreen_granted() const { return is_fullscreen_granted_; }
blink::WebDisplayMode display_mode() const { return display_mode_; }
bool is_hidden() const { return is_hidden_; }
......
......@@ -337,7 +337,9 @@ void RenderWidgetFullscreenPepper::SetLayer(blink::WebLayer* layer) {
}
if (!compositor())
InitializeLayerTreeView();
layer_->SetBounds(blink::WebSize(size()));
// Note that root cc::Layers' bounds are specified in pixels (in contrast with
// non-root cc::Layers' bounds, which are specified in DIPs).
layer_->SetBounds(blink::WebSize(compositor_viewport_pixel_size()));
layer_->SetDrawsContent(true);
compositor_->SetRootLayer(*layer_);
}
......@@ -375,8 +377,10 @@ void RenderWidgetFullscreenPepper::Close() {
}
void RenderWidgetFullscreenPepper::OnResize(const ResizeParams& params) {
// Note that root cc::Layers' bounds are specified in pixels (in contrast with
// non-root cc::Layers' bounds, which are specified in DIPs).
if (layer_)
layer_->SetBounds(blink::WebSize(params.new_size));
layer_->SetBounds(blink::WebSize(params.physical_backing_size));
RenderWidget::OnResize(params);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment