summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 22:01:50 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 22:01:50 +0000
commit94c40e629c13f38e8eff6f8435ea490b7d40dbb9 (patch)
tree38578f86de47e92040742c8dd5e84a5910c2e5a7 /content
parentf66375e4d724f5da1a406d553259685451cdf55d (diff)
downloadchromium_src-94c40e629c13f38e8eff6f8435ea490b7d40dbb9.zip
chromium_src-94c40e629c13f38e8eff6f8435ea490b7d40dbb9.tar.gz
chromium_src-94c40e629c13f38e8eff6f8435ea490b7d40dbb9.tar.bz2
Part 1/3 (compositor) of adding with device scale factor to transport surfaces
Add a DeviceScaleFactor method to RendererClient (and all its instances) to get the scale factor from the layer tree to the output surface. Add a scale factor argument to OutputSurface::Reshape Replace OutputSurface::Reshape's use of WebGraphicsContext3D's reshape with reshapeWithScaleFactor. Implement reshapeWithScaleFactor for command buffer based WebGraphicsContext3Ds, but stop propagating the scale factor argument there. BUG=132714 Review URL: https://chromiumcodereview.appspot.com/15688002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/compositor_impl_android.cc2
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc5
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h2
-rw-r--r--content/renderer/android/synchronous_compositor_output_surface.cc3
-rw-r--r--content/renderer/android/synchronous_compositor_output_surface.h2
-rw-r--r--content/renderer/gpu/mailbox_output_surface.cc2
-rw-r--r--content/renderer/gpu/mailbox_output_surface.h2
7 files changed, 13 insertions, 5 deletions
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 51d2159..f14932b 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -48,7 +48,7 @@ class DirectOutputSurface : public cc::OutputSurface {
DirectOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d)
: cc::OutputSurface(context3d.Pass()) {}
- virtual void Reshape(gfx::Size size) OVERRIDE {}
+ virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE {}
virtual void PostSubBuffer(gfx::Rect rect, const cc::LatencyInfo&) OVERRIDE {}
virtual void SwapBuffers(const cc::LatencyInfo&) OVERRIDE {
context3d()->shallowFlushCHROMIUM();
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index b5ee5c4..33f6ea1 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -567,6 +567,11 @@ void WebGraphicsContext3DCommandBufferImpl::postSubBufferCHROMIUM(
}
void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) {
+ reshapeWithScaleFactor(width, height, 1.f);
+}
+
+void WebGraphicsContext3DCommandBufferImpl::reshapeWithScaleFactor(
+ int width, int height, float scale_factor) {
cached_width_ = width;
cached_height_ = height;
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
index e7c164f..d39097d 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
@@ -128,6 +128,8 @@ class WebGraphicsContext3DCommandBufferImpl
WebGraphicsSyncPointCallback* callback);
virtual void reshape(int width, int height);
+ virtual void reshapeWithScaleFactor(
+ int width, int height, float scale_factor);
virtual bool readBackFramebuffer(unsigned char* pixels, size_t buffer_size);
virtual bool readBackFramebuffer(unsigned char* pixels, size_t buffer_size,
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
index 7acdf8a..d0ddf4d 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -119,7 +119,8 @@ bool SynchronousCompositorOutputSurface::BindToClient(
return true;
}
-void SynchronousCompositorOutputSurface::Reshape(gfx::Size size) {
+void SynchronousCompositorOutputSurface::Reshape(
+ gfx::Size size, float scale_factor) {
// Intentional no-op: surface size is controlled by the embedder.
}
diff --git a/content/renderer/android/synchronous_compositor_output_surface.h b/content/renderer/android/synchronous_compositor_output_surface.h
index 69eec2e..6748e9c 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.h
+++ b/content/renderer/android/synchronous_compositor_output_surface.h
@@ -34,7 +34,7 @@ class SynchronousCompositorOutputSurface
// OutputSurface.
virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE;
virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE;
- virtual void Reshape(gfx::Size size) OVERRIDE;
+ virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE;
virtual void SendFrameToParentCompositor(cc::CompositorFrame* frame) OVERRIDE;
virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
virtual void SwapBuffers(const cc::LatencyInfo& info) OVERRIDE;
diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc
index 936f466..2324fe8 100644
--- a/content/renderer/gpu/mailbox_output_surface.cc
+++ b/content/renderer/gpu/mailbox_output_surface.cc
@@ -113,7 +113,7 @@ void MailboxOutputSurface::DiscardBackbuffer() {
}
}
-void MailboxOutputSurface::Reshape(gfx::Size size) {
+void MailboxOutputSurface::Reshape(gfx::Size size, float scale_factor) {
if (size == size_)
return;
diff --git a/content/renderer/gpu/mailbox_output_surface.h b/content/renderer/gpu/mailbox_output_surface.h
index 7c159be..77fc7d4 100644
--- a/content/renderer/gpu/mailbox_output_surface.h
+++ b/content/renderer/gpu/mailbox_output_surface.h
@@ -32,7 +32,7 @@ class MailboxOutputSurface : public CompositorOutputSurface {
virtual void SendFrameToParentCompositor(cc::CompositorFrame* frame) OVERRIDE;
virtual void EnsureBackbuffer() OVERRIDE;
virtual void DiscardBackbuffer() OVERRIDE;
- virtual void Reshape(gfx::Size size) OVERRIDE;
+ virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE;
virtual void BindFramebuffer() OVERRIDE;
virtual void PostSubBuffer(gfx::Rect rect, const cc::LatencyInfo&) OVERRIDE;
virtual void SwapBuffers(const cc::LatencyInfo&) OVERRIDE;