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

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

Issue 1251783002: Mac Overlays: Wire up overlays on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@part22
Patch Set: Leave widget type unchanged Created 5 years, 5 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 | « content/content_common.gypi ('k') | ui/gl/BUILD.gn » ('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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // fiddle with the position of sub-layers -- they will always be at the 50 // fiddle with the position of sub-layers -- they will always be at the
51 // origin. 51 // origin.
52 flipped_layer_.reset([[CALayer alloc] init]); 52 flipped_layer_.reset([[CALayer alloc] init]);
53 [flipped_layer_ setGeometryFlipped:YES]; 53 [flipped_layer_ setGeometryFlipped:YES];
54 [flipped_layer_ setAnchorPoint:CGPointMake(0, 0)]; 54 [flipped_layer_ setAnchorPoint:CGPointMake(0, 0)];
55 [flipped_layer_ 55 [flipped_layer_
56 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable]; 56 setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable];
57 57
58 // Use a sequence number as the accelerated widget handle that we can use 58 // Use a sequence number as the accelerated widget handle that we can use
59 // to look up the internals structure. 59 // to look up the internals structure.
60 static uintptr_t last_sequence_number = 0; 60 static intptr_t last_sequence_number = 0;
61 last_sequence_number += 1; 61 last_sequence_number += 1;
62 native_widget_ = reinterpret_cast<gfx::AcceleratedWidget>( 62 native_widget_ = reinterpret_cast<gfx::AcceleratedWidget>(
63 last_sequence_number); 63 last_sequence_number);
64 g_widget_to_helper_map.Pointer()->insert( 64 g_widget_to_helper_map.Pointer()->insert(
65 std::make_pair(native_widget_, this)); 65 std::make_pair(native_widget_, this));
66 } 66 }
67 67
68 AcceleratedWidgetMac::~AcceleratedWidgetMac() { 68 AcceleratedWidgetMac::~AcceleratedWidgetMac() {
69 DCHECK(!view_); 69 DCHECK(!view_);
70 g_widget_to_helper_map.Pointer()->erase(native_widget_); 70 g_widget_to_helper_map.Pointer()->erase(native_widget_);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 void AcceleratedWidgetMacGotSoftwareFrame( 384 void AcceleratedWidgetMacGotSoftwareFrame(
385 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas) { 385 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas) {
386 AcceleratedWidgetMac* accelerated_widget_mac = 386 AcceleratedWidgetMac* accelerated_widget_mac =
387 GetHelperFromAcceleratedWidget(widget); 387 GetHelperFromAcceleratedWidget(widget);
388 if (accelerated_widget_mac) 388 if (accelerated_widget_mac)
389 accelerated_widget_mac->GotSoftwareFrame(scale_factor, canvas); 389 accelerated_widget_mac->GotSoftwareFrame(scale_factor, canvas);
390 } 390 }
391 391
392 } // namespace ui 392 } // namespace ui
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | ui/gl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698