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

Unified Diff: content/browser/compositor/browser_compositor_view_mac.h

Issue 294023012: Use a separate NSView to draw browser composited content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments, clean-u 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
« no previous file with comments | « no previous file | content/browser/compositor/browser_compositor_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/browser_compositor_view_mac.h
diff --git a/content/browser/compositor/browser_compositor_view_mac.h b/content/browser/compositor/browser_compositor_view_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1988c26a5addcadd5700c288feb665fb970b42c
--- /dev/null
+++ b/content/browser/compositor/browser_compositor_view_mac.h
@@ -0,0 +1,53 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_MAC_H_
+#define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/mac/scoped_nsobject.h"
+#include "cc/output/software_frame_data.h"
+#include "content/browser/renderer_host/compositing_iosurface_layer_mac.h"
+#include "content/browser/renderer_host/software_layer_mac.h"
+#include "skia/ext/platform_canvas.h"
+#include "ui/compositor/compositor.h"
+#include "ui/gfx/geometry/size.h"
+
+@class BrowserCompositorViewMac;
+
+// Additions to the NSView interface for compositor frames.
+@interface NSView (BrowserCompositorView)
+- (void)gotAcceleratedIOSurfaceFrame:(uint64)surface_handle
+ withPixelSize:(gfx::Size)pixel_size
+ withScaleFactor:(float)scale_factor;
+
+- (void)gotSoftwareFrame:(cc::SoftwareFrameData*)frame_data
+ withScaleFactor:(float)scale_factor
+ withCanvas:(SkCanvas*)canvas;
+@end
+
+// NSView drawn by a ui::Compositor. The superview of this view is responsible
+// for changing the ui::Compositor SizeAndScale and calling layoutLayers when
+// the size of the parent view may change. This interface is patterned after
+// the needs of RenderWidgetHostViewCocoa, and could change.
+@interface BrowserCompositorViewMac : NSView {
+ scoped_ptr<ui::Compositor> compositor_;
+ base::scoped_nsobject<CALayer> background_layer_;
+ base::scoped_nsobject<CompositingIOSurfaceLayer> accelerated_layer_;
+ base::scoped_nsobject<SoftwareLayer> software_layer_;
+}
+
+// Initialize to render the content of a specific superview.
+- (id)initWithSuperview:(NSView*)view;
+
+// Re-position the layers to the correct place when this view's superview
+// changes size, or when the accelerated or software content changes.
+- (void)layoutLayers;
+
+// Access the underlying ui::Compositor for this view.
+- (ui::Compositor*)compositor;
+@end
+
+#endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_VIEW_MAC_H_
« no previous file with comments | « no previous file | content/browser/compositor/browser_compositor_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698