From ca8062bf5f338ae347dc3d7e580c8fe1966b3539 Mon Sep 17 00:00:00 2001 From: "jscholler@chromium.org" Date: Wed, 13 Feb 2013 09:24:52 +0000 Subject: 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 --- content/browser/renderer_host/compositor_impl_android.cc | 4 ++++ content/browser/renderer_host/compositor_impl_android.h | 1 + content/public/browser/android/compositor.h | 3 +++ 3 files changed, 8 insertions(+) (limited to 'content') 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 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 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; -- cgit v1.1