diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-21 03:21:07 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-21 03:21:07 +0000 |
commit | 7b4bff53c5278de18e6e565743aabee1e1a5bcbe (patch) | |
tree | b28981432f1df0a97dad2e055c64abea92705837 /cc/output/software_output_device.h | |
parent | d5801aea4ece5a63b3ed83365f957a6d38556293 (diff) | |
download | chromium_src-7b4bff53c5278de18e6e565743aabee1e1a5bcbe.zip chromium_src-7b4bff53c5278de18e6e565743aabee1e1a5bcbe.tar.gz chromium_src-7b4bff53c5278de18e6e565743aabee1e1a5bcbe.tar.bz2 |
Make delegated software renderer work on Mac
Add a device scale factor parameter to SoftwareOutputDevice::Resize and
plumb that parameter through to the contentsScale property of the CALayer
that is used to draw the software frame.
Change the way that RWHVMac draws software frames (both delegated and
non-delegated) so that the CALayer for the software frame has setContents
called on it with a CGImageRef of the software frame, instead of drawing
the CGImageRef to the inside the CALayer's displayInContext function. This
is the way that things should have been done to begin with (it involves a lot
less copying and a lot more idle time in the browser main thread), but wasn't
compatible with the (now-defunct) legacy software path.
Change the software rendering path to set the contentsScale of the software
CALayer at the time that the software frame is received, when the contents
are updated, instead of in RWHVMac::LayoutLayers.
BUG=314190
Review URL: https://codereview.chromium.org/297573003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/software_output_device.h')
-rw-r--r-- | cc/output/software_output_device.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cc/output/software_output_device.h b/cc/output/software_output_device.h index e371654..e8de5b9 100644 --- a/cc/output/software_output_device.h +++ b/cc/output/software_output_device.h @@ -36,7 +36,7 @@ class CC_EXPORT SoftwareOutputDevice { // Discards any pre-existing backing buffers and allocates memory for a // software device of |size|. This must be called before the // |SoftwareOutputDevice| can be used in other ways. - virtual void Resize(const gfx::Size& size); + virtual void Resize(const gfx::Size& pixel_size, float scale_factor); // Called on BeginDrawingFrame. The compositor will draw into the returned // SkCanvas. The |SoftwareOutputDevice| implementation needs to provide a @@ -74,7 +74,8 @@ class CC_EXPORT SoftwareOutputDevice { virtual gfx::VSyncProvider* GetVSyncProvider(); protected: - gfx::Size viewport_size_; + gfx::Size viewport_pixel_size_; + float scale_factor_; gfx::Rect damage_rect_; skia::RefPtr<SkCanvas> canvas_; scoped_ptr<gfx::VSyncProvider> vsync_provider_; |