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

Unified Diff: ui/accelerated_widget_mac/accelerated_widget_mac.h

Issue 2018793002: Mac: Move remote layer use to GpuOutputSurfaceMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean_up_mac
Patch Set: Review feedback Created 4 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: 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 01bb51071121aa8af8b24b655f18d2f408abc0ae..b14b6fb7e2a851c2947e99c1f2397a5f98633b08 100644
--- a/ui/accelerated_widget_mac/accelerated_widget_mac.h
+++ b/ui/accelerated_widget_mac/accelerated_widget_mac.h
@@ -5,10 +5,12 @@
#ifndef UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
#define UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
+#import <Cocoa/Cocoa.h>
#include <IOSurface/IOSurface.h>
#include <vector>
#include "base/mac/scoped_cftyperef.h"
+#import "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#include "base/time/time.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h"
@@ -17,11 +19,6 @@
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
-#if defined(__OBJC__)
-#import <Cocoa/Cocoa.h>
-#import "base/mac/scoped_nsobject.h"
-#endif // __OBJC__
-
class SkCanvas;
namespace cc {
@@ -30,7 +27,6 @@ class SoftwareFrameData;
namespace ui {
-class AcceleratedWidgetMac;
class FullscreenLowPowerCoordinator;
// A class through which an AcceleratedWidget may be bound to draw the contents
@@ -44,8 +40,6 @@ class AcceleratedWidgetMacNSView {
virtual void AcceleratedWidgetSwapCompleted() = 0;
};
-#if defined(__OBJC__)
-
// AcceleratedWidgetMac owns a tree of CALayers. The widget may be passed
// to a ui::Compositor, which will cause, through its output surface, calls to
// GotAcceleratedFrame and GotSoftwareFrame. The CALayers may be installed
@@ -77,33 +71,18 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
void GetVSyncParameters(
base::TimeTicks* timebase, base::TimeDelta* interval) const;
- void GotFrame(CAContextID ca_context_id,
- bool fullscreen_low_power_ca_context_valid,
- CAContextID fullscreen_low_power_ca_context_id,
- base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
- const gfx::Size& pixel_size,
- float scale_factor);
-
- private:
- void GotCAContextFrame(CAContextID ca_context_id,
- bool fullscreen_low_power_ca_context_valid,
- CAContextID fullscreen_low_power_ca_context_id,
- const gfx::Size& pixel_size,
- float scale_factor);
-
+ static AcceleratedWidgetMac* Get(gfx::AcceleratedWidget widget);
+ void GotCALayerFrame(
+ base::scoped_nsobject<CALayer> content_layer,
+ bool fullscreen_low_power_layer_valid,
+ base::scoped_nsobject<CALayer> fullscreen_low_power_layer,
+ const gfx::Size& pixel_size,
+ float scale_factor);
void GotIOSurfaceFrame(base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
const gfx::Size& pixel_size,
float scale_factor);
- // Remove a layer from the heirarchy and destroy it. Because the accelerated
- // layer types may be replaced by a layer of the same type, the layer to
- // destroy is parameterized, and, if it is the current layer, the current
- // layer is reset.
- void DestroyCAContextLayer(
- base::scoped_nsobject<CALayerHost> ca_context_layer);
- void DestroyLocalLayer();
- void EnsureLocalLayer();
-
+ private:
// The AcceleratedWidgetMacNSView that is using this as its internals.
AcceleratedWidgetMacNSView* view_;
@@ -123,12 +102,12 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
// behavior.
base::scoped_nsobject<CALayer> flipped_layer_;
- // The accelerated CoreAnimation layers hosted by the GPU process.
- base::scoped_nsobject<CALayerHost> ca_context_layer_;
- base::scoped_nsobject<CALayerHost> fullscreen_low_power_layer_;
+ // A CALayer with content provided by the output surface.
+ base::scoped_nsobject<CALayer> content_layer_;
+ base::scoped_nsobject<CALayer> fullscreen_low_power_layer_;
- // The locally drawn layer, which has its contents set to an IOSurface.
- base::scoped_nsobject<CALayer> local_layer_;
+ // A CALayer that has its content set to an IOSurface.
+ base::scoped_nsobject<CALayer> io_surface_layer_;
// The size in DIP of the last swap received from |compositor_|.
gfx::Size last_swap_size_dip_;
@@ -136,20 +115,6 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac);
};
-#endif // __OBJC__
-
-ACCELERATED_WIDGET_MAC_EXPORT
-void AcceleratedWidgetMacGotFrame(
- gfx::AcceleratedWidget widget,
- CAContextID ca_context_id,
- bool fullscreen_low_power_ca_context_valid,
- CAContextID fullscreen_low_power_ca_context_id,
- base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
- const gfx::Size& pixel_size,
- float scale_factor,
- base::TimeTicks* vsync_timebase,
- base::TimeDelta* vsync_interval);
-
} // namespace ui
#endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
« no previous file with comments | « content/browser/renderer_host/browser_compositor_view_mac.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