Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: content/browser/renderer_host/compositing_iosurface_mac.mm

Issue 15689003: Part 3/3 (RWH/IOSurface) of adding with device scale factor to transport surfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositing_iosurface_mac.mm
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm
index 40bb0e42945297a5f30755ec268627b46ec8e311..85aafda411983ed8016123ffc3b9c8b5401e25b0 100644
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm
@@ -335,13 +335,6 @@ void CompositingIOSurfaceMac::SwitchToContextOnNewWindow(
context_ = new_context;
}
-void CompositingIOSurfaceMac::SetDeviceScaleFactor(float scale_factor) {
- // TODO: After a resolution change, the DPI-ness of the view and the
- // IOSurface might not be in sync.
- io_surface_size_ = gfx::ToFlooredSize(
- gfx::ScaleSize(pixel_io_surface_size_, 1.0 / scale_factor));
-}
-
bool CompositingIOSurfaceMac::is_vsync_disabled() const {
return context_->is_vsync_disabled();
}
@@ -366,8 +359,11 @@ CompositingIOSurfaceMac::~CompositingIOSurfaceMac() {
}
void CompositingIOSurfaceMac::SetIOSurface(uint64 io_surface_handle,
- const gfx::Size& size) {
+ const gfx::Size& size,
+ float scale_factor) {
pixel_io_surface_size_ = size;
+ io_surface_size_ = gfx::ToFlooredSize(
+ gfx::ScaleSize(pixel_io_surface_size_, 1.0 / scale_factor));
Nico 2013/05/22 15:33:22 Does this still have to be a member variable, or c
ccameron 2013/05/22 20:50:12 It's also used when checking HasAcceleratedSurface
CGLSetCurrentContext(context_->cgl_context());
MapIOSurfaceToTexture(io_surface_handle);
CGLSetCurrentContext(0);
@@ -407,8 +403,6 @@ void CompositingIOSurfaceMac::DrawIOSurface(
gfx::ScaleSize(window_size, scale_factor));
glViewport(0, 0, pixel_window_size.width(), pixel_window_size.height());
- SetDeviceScaleFactor(scale_factor);
-
SurfaceQuad quad;
quad.set_size(io_surface_size_, pixel_io_surface_size_);
@@ -617,10 +611,6 @@ bool CompositingIOSurfaceMac::MapIOSurfaceToTexture(
io_surface_support_->IOSurfaceGetWidth(io_surface_),
io_surface_support_->IOSurfaceGetHeight(io_surface_));
- // TODO(thakis): Keep track of the view size over IPC. At the moment,
- // the correct view units are computed on first paint.
- io_surface_size_ = pixel_io_surface_size_;
Nico 2013/05/22 15:33:22 \o/
-
GLenum target = GL_TEXTURE_RECTANGLE_ARB;
glGenTextures(1, &texture_);
glBindTexture(target, texture_);
« no previous file with comments | « content/browser/renderer_host/compositing_iosurface_mac.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698