OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "content/browser/compositor/software_output_device_mac.h" | 7 #include "content/browser/compositor/software_output_device_mac.h" |
8 | 8 |
| 9 #include "content/browser/compositor/browser_compositor_view_mac.h" |
9 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
10 | 11 |
11 // Declare methods used to present swaps to this view. | |
12 @interface NSView (SoftwareDelegatedFrame) | |
13 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data | |
14 withScaleFactor:(float)scale_factor | |
15 withCanvas:(SkCanvas*)canvas; | |
16 @end | |
17 | |
18 @implementation NSView (SoftwareDelegatedFrame) | |
19 - (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data | |
20 withScaleFactor:(float)scale_factor | |
21 withCanvas:(SkCanvas*)canvas { | |
22 } | |
23 @end | |
24 | |
25 namespace content { | 12 namespace content { |
26 | 13 |
27 SoftwareOutputDeviceMac::SoftwareOutputDeviceMac(ui::Compositor* compositor) | 14 SoftwareOutputDeviceMac::SoftwareOutputDeviceMac(ui::Compositor* compositor) |
28 : compositor_(compositor) { | 15 : compositor_(compositor) { |
29 } | 16 } |
30 | 17 |
31 SoftwareOutputDeviceMac::~SoftwareOutputDeviceMac() { | 18 SoftwareOutputDeviceMac::~SoftwareOutputDeviceMac() { |
32 } | 19 } |
33 | 20 |
34 void SoftwareOutputDeviceMac::EndPaint(cc::SoftwareFrameData* frame_data) { | 21 void SoftwareOutputDeviceMac::EndPaint(cc::SoftwareFrameData* frame_data) { |
35 SoftwareOutputDevice::EndPaint(frame_data); | 22 SoftwareOutputDevice::EndPaint(frame_data); |
36 | 23 |
37 NSView* view = compositor_->widget(); | 24 NSView* view = compositor_->widget(); |
38 [view gotSoftwareFrame:frame_data | 25 [view gotSoftwareFrame:frame_data |
39 withScaleFactor:scale_factor_ | 26 withScaleFactor:scale_factor_ |
40 withCanvas:canvas_.get()]; | 27 withCanvas:canvas_.get()]; |
41 } | 28 } |
42 | 29 |
43 } // namespace content | 30 } // namespace content |
OLD | NEW |