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

Unified Diff: ui/accelerated_widget_mac/accelerated_widget_mac.h

Issue 1844053002: Add detached mode plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And target Created 4 years, 9 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: ui/accelerated_widget_mac/accelerated_widget_mac.h
diff --git a/ui/accelerated_widget_mac/accelerated_widget_mac.h b/ui/accelerated_widget_mac/accelerated_widget_mac.h
index fea9a515e8d103e0af5024f9730eefd5f39a10b7..7126101b4254b8f79d8e03943914818aaa456821 100644
--- a/ui/accelerated_widget_mac/accelerated_widget_mac.h
+++ b/ui/accelerated_widget_mac/accelerated_widget_mac.h
@@ -10,6 +10,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h"
#include "ui/base/cocoa/remote_layer_api.h"
@@ -20,6 +21,7 @@
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#import "base/mac/scoped_nsobject.h"
+@class DetachedModeWindow;
#endif // __OBJC__
class SkCanvas;
@@ -68,11 +70,20 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
void GotFrame(CAContextID ca_context_id,
base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
+ bool use_detached,
+ CAContextID detached_ca_context_id,
const gfx::Size& pixel_size,
float scale_factor);
+ NSWindow* CreateDetachedModeWindow();
+ void DestroyDetachedModeWindow();
+ void EnterDetachedMode();
+ void LeaveDetachedMode();
+
private:
void GotCAContextFrame(CAContextID ca_context_id,
+ bool use_detached,
+ CAContextID detached_ca_context_id,
const gfx::Size& pixel_size,
float scale_factor);
@@ -95,6 +106,8 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
// A phony NSView handle used to identify this.
gfx::AcceleratedWidget native_widget_;
+ base::scoped_nsobject<DetachedModeWindow> detached_mode_window_;
+
// A flipped layer, which acts as the parent of the compositing and software
// layers. This layer is flipped so that the we don't need to recompute the
// origin for sub-layers when their position changes (this is impossible when
@@ -106,6 +119,8 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
// The accelerated CoreAnimation layer hosted by the GPU process.
base::scoped_nsobject<CALayerHost> ca_context_layer_;
+ base::scoped_nsobject<CALayerHost> detached_ca_context_layer_;
+ bool in_detached_mode_ = false;
// The locally drawn layer, which has its contents set to an IOSurface.
base::scoped_nsobject<CALayer> local_layer_;
@@ -113,6 +128,7 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
// The size in DIP of the last swap received from |compositor_|.
gfx::Size last_swap_size_dip_;
+ base::WeakPtrFactory<AcceleratedWidgetMac> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac);
};
@@ -123,6 +139,8 @@ void AcceleratedWidgetMacGotFrame(
gfx::AcceleratedWidget widget,
CAContextID ca_context_id,
base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
+ bool use_detached,
+ CAContextID detached_ca_context_id,
const gfx::Size& pixel_size,
float scale_factor,
base::TimeTicks* vsync_timebase,
« no previous file with comments | « content/public/browser/render_widget_host_view.h ('k') | ui/accelerated_widget_mac/accelerated_widget_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698