summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjscholler@chromium.org <jscholler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 09:24:52 +0000
committerjscholler@chromium.org <jscholler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 09:24:52 +0000
commitca8062bf5f338ae347dc3d7e580c8fe1966b3539 (patch)
tree5ab7bc323cbed0513085122405732c308fe323e2 /content
parentf96554842a428f56f6d940aa79e1760c0178f50e (diff)
downloadchromium_src-ca8062bf5f338ae347dc3d7e580c8fe1966b3539.zip
chromium_src-ca8062bf5f338ae347dc3d7e580c8fe1966b3539.tar.gz
chromium_src-ca8062bf5f338ae347dc3d7e580c8fe1966b3539.tar.bz2
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
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/compositor_impl_android.cc4
-rw-r--r--content/browser/renderer_host/compositor_impl_android.h1
-rw-r--r--content/public/browser/android/compositor.h3
3 files changed, 8 insertions, 0 deletions
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 8035ab7..a68db9b 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -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;
diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h
index eeb33e8..07a3353 100644
--- a/content/browser/renderer_host/compositor_impl_android.h
+++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -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(
diff --git a/content/public/browser/android/compositor.h b/content/public/browser/android/compositor.h
index 7cf5da5..7d3d3b9 100644
--- a/content/public/browser/android/compositor.h
+++ b/content/public/browser/android/compositor.h
@@ -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;