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

Unified Diff: content/browser/compositor/software_output_device_mac.mm

Issue 297573003: Make delegated software renderer work on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows build Created 6 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698