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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 14846015: Update IOSurface scale factor before compare (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/compositing_iosurface_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #include <QuartzCore/QuartzCore.h> 7 #include <QuartzCore/QuartzCore.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 if (compositing_iosurface_) 1321 if (compositing_iosurface_)
1322 compositing_iosurface_->UnrefIOSurface(); 1322 compositing_iosurface_->UnrefIOSurface();
1323 } 1323 }
1324 1324
1325 void RenderWidgetHostViewMac::AcceleratedSurfaceRelease() { 1325 void RenderWidgetHostViewMac::AcceleratedSurfaceRelease() {
1326 compositing_iosurface_.reset(); 1326 compositing_iosurface_.reset();
1327 } 1327 }
1328 1328
1329 bool RenderWidgetHostViewMac::HasAcceleratedSurface( 1329 bool RenderWidgetHostViewMac::HasAcceleratedSurface(
1330 const gfx::Size& desired_size) { 1330 const gfx::Size& desired_size) {
1331 // Update device scale factor for the IOSurface before checking if there
1332 // is a match. When initially created, the IOSurface is unaware of its
1333 // scale factor, which can result in compatible IOSurfaces not being used
1334 // http://crbug.com/237293
1335 if (compositing_iosurface_.get() &&
1336 compositing_iosurface_->HasIOSurface()) {
1337 compositing_iosurface_->SetDeviceScaleFactor(ScaleFactor(cocoa_view_));
Ken Russell (switch to Gerrit) 2013/05/07 19:23:51 It seems odd that this is done as a side-effect of
ccameron 2013/05/07 19:27:36 Yes, this I was unhappy with this too. The other p
1338 }
1339
1331 return last_frame_was_accelerated_ && 1340 return last_frame_was_accelerated_ &&
1332 compositing_iosurface_.get() && 1341 compositing_iosurface_.get() &&
1333 compositing_iosurface_->HasIOSurface() && 1342 compositing_iosurface_->HasIOSurface() &&
1334 (desired_size.IsEmpty() || 1343 (desired_size.IsEmpty() ||
1335 compositing_iosurface_->io_surface_size() == desired_size); 1344 compositing_iosurface_->io_surface_size() == desired_size);
1336 } 1345 }
1337 1346
1338 void RenderWidgetHostViewMac::AboutToWaitForBackingStoreMsg() { 1347 void RenderWidgetHostViewMac::AboutToWaitForBackingStoreMsg() {
1339 AckPendingSwapBuffers(); 1348 AckPendingSwapBuffers();
1340 } 1349 }
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
3370 if (!string) return NO; 3379 if (!string) return NO;
3371 3380
3372 // If the user is currently using an IME, confirm the IME input, 3381 // If the user is currently using an IME, confirm the IME input,
3373 // and then insert the text from the service, the same as TextEdit and Safari. 3382 // and then insert the text from the service, the same as TextEdit and Safari.
3374 [self confirmComposition]; 3383 [self confirmComposition];
3375 [self insertText:string]; 3384 [self insertText:string];
3376 return YES; 3385 return YES;
3377 } 3386 }
3378 3387
3379 @end 3388 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositing_iosurface_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698