OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 #include "content/browser/compositor/software_output_device_mac.h" |
| 8 |
| 9 #include "ui/compositor/compositor.h" |
| 10 |
| 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 { |
| 26 |
| 27 SoftwareOutputDeviceMac::SoftwareOutputDeviceMac(ui::Compositor* compositor) |
| 28 : compositor_(compositor) { |
| 29 } |
| 30 |
| 31 SoftwareOutputDeviceMac::~SoftwareOutputDeviceMac() { |
| 32 } |
| 33 |
| 34 void SoftwareOutputDeviceMac::EndPaint(cc::SoftwareFrameData* frame_data) { |
| 35 SoftwareOutputDevice::EndPaint(frame_data); |
| 36 |
| 37 NSView* view = compositor_->widget(); |
| 38 [view gotSoftwareFrame:frame_data |
| 39 withScaleFactor:scale_factor_ |
| 40 withCanvas:canvas_.get()]; |
| 41 } |
| 42 |
| 43 } // namespace content |
OLD | NEW |