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

Side by Side Diff: ui/accelerated_widget_mac/accelerated_widget_mac.mm

Issue 1917973002: mac: Remove IsOSLion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tapted Created 4 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
« no previous file with comments | « sandbox/mac/os_compatibility.cc ('k') | ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/accelerated_widget_mac/accelerated_widget_mac.h" 5 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 if (new_contents && new_contents == [local_layer_ contents]) { 197 if (new_contents && new_contents == [local_layer_ contents]) {
198 [local_layer_ setContentsChanged]; 198 [local_layer_ setContentsChanged];
199 } else { 199 } else {
200 [local_layer_ setContents:new_contents]; 200 [local_layer_ setContents:new_contents];
201 } 201 }
202 202
203 [local_layer_ setBounds:CGRectMake(0, 0, pixel_size.width() / scale_factor, 203 [local_layer_ setBounds:CGRectMake(0, 0, pixel_size.width() / scale_factor,
204 pixel_size.height() / scale_factor)]; 204 pixel_size.height() / scale_factor)];
205 205
206 if ([local_layer_ respondsToSelector:(@selector(contentsScale))] && 206 if ([local_layer_ contentsScale] != scale_factor)
207 [local_layer_ respondsToSelector:(@selector(setContentsScale:))] &&
208 [local_layer_ contentsScale] != scale_factor) {
209 DCHECK(base::mac::IsOSLionOrLater());
210 [local_layer_ setContentsScale:scale_factor]; 207 [local_layer_ setContentsScale:scale_factor];
211 }
212 208
213 // Remove any different-type layers that this is replacing. 209 // Remove any different-type layers that this is replacing.
214 DestroyCAContextLayer(ca_context_layer_); 210 DestroyCAContextLayer(ca_context_layer_);
215 } 211 }
216 212
217 void AcceleratedWidgetMac::DestroyCAContextLayer( 213 void AcceleratedWidgetMac::DestroyCAContextLayer(
218 base::scoped_nsobject<CALayerHost> ca_context_layer) { 214 base::scoped_nsobject<CALayerHost> ca_context_layer) {
219 if (!ca_context_layer) 215 if (!ca_context_layer)
220 return; 216 return;
221 [ca_context_layer removeFromSuperlayer]; 217 [ca_context_layer removeFromSuperlayer];
(...skipping 28 matching lines...) Expand all
250 accelerated_widget_mac->GotFrame(ca_context_id, io_surface, pixel_size, 246 accelerated_widget_mac->GotFrame(ca_context_id, io_surface, pixel_size,
251 scale_factor); 247 scale_factor);
252 if (vsync_timebase && vsync_interval) { 248 if (vsync_timebase && vsync_interval) {
253 accelerated_widget_mac->GetVSyncParameters(vsync_timebase, 249 accelerated_widget_mac->GetVSyncParameters(vsync_timebase,
254 vsync_interval); 250 vsync_interval);
255 } 251 }
256 } 252 }
257 } 253 }
258 254
259 } // namespace ui 255 } // namespace ui
OLDNEW
« no previous file with comments | « sandbox/mac/os_compatibility.cc ('k') | ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698