Index: content/browser/compositor/software_output_device_mac.mm |
diff --git a/content/browser/compositor/software_output_device_mac.mm b/content/browser/compositor/software_output_device_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..84670bd8a2e344750ae9bf3d55e3bf29b0fc6277 |
--- /dev/null |
+++ b/content/browser/compositor/software_output_device_mac.mm |
@@ -0,0 +1,43 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#include "content/browser/compositor/software_output_device_mac.h" |
+ |
+#include "ui/compositor/compositor.h" |
+ |
+// Declare methods used to present swaps to this view. |
+@interface NSView (SoftwareDelegatedFrame) |
+- (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data |
+ withScaleFactor:(float)scale_factor |
+ withCanvas:(SkCanvas*)canvas; |
+@end |
+ |
+@implementation NSView (SoftwareDelegatedFrame) |
+- (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data |
+ withScaleFactor:(float)scale_factor |
+ withCanvas:(SkCanvas*)canvas { |
+} |
+@end |
+ |
+namespace content { |
+ |
+SoftwareOutputDeviceMac::SoftwareOutputDeviceMac(ui::Compositor* compositor) |
+ : compositor_(compositor) { |
+} |
+ |
+SoftwareOutputDeviceMac::~SoftwareOutputDeviceMac() { |
+} |
+ |
+void SoftwareOutputDeviceMac::EndPaint(cc::SoftwareFrameData* frame_data) { |
+ SoftwareOutputDevice::EndPaint(frame_data); |
+ |
+ NSView* view = compositor_->widget(); |
+ [view gotSoftwareFrame:frame_data |
+ withScaleFactor:scale_factor_ |
+ withCanvas:canvas_.get()]; |
+} |
+ |
+} // namespace content |