Set the device scale factor from the compositor interface

Android browser compositor does not have access directly to the
LayerTreeHost, only the compositor. This CL allows to set the
device scale factor from the compositor interface.

BUG=175589


Review URL: https://chromiumcodereview.appspot.com/12220110

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182171 0039d316-1c4b-4281-b951-d872f2087c98
parent f9655484
......@@ -196,6 +196,10 @@ void CompositorImpl::SetVisible(bool visible) {
}
}
void CompositorImpl::setDeviceScaleFactor(float factor) {
host_->setDeviceScaleFactor(factor);
}
void CompositorImpl::SetWindowBounds(const gfx::Size& size) {
if (size_ == size)
return;
......
......@@ -46,6 +46,7 @@ class CONTENT_EXPORT CompositorImpl
virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE;
virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE;
virtual void SetVisible(bool visible) OVERRIDE;
virtual void setDeviceScaleFactor(float factor) OVERRIDE;
virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE;
virtual void SetHasTransparentBackground(bool flag) OVERRIDE;
virtual bool CompositeAndReadback(
......
......@@ -60,6 +60,9 @@ class CONTENT_EXPORT Compositor {
// Attaches the layer tree.
virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0;
// Set the scale factor from DIP to pixel.
virtual void setDeviceScaleFactor(float factor) = 0;
// Set the output surface bounds.
virtual void SetWindowBounds(const gfx::Size& size) = 0;
......
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