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

Unified Diff: ui/accelerated_widget_mac/accelerated_widget_mac.h

Issue 1420533005: Mac: Kill lots of AcceleratedWidget code (with fire) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting Created 5 years, 2 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 39142965f0f01bc3922f449b61a2d18b6c8f5068..6d05c7916f9904dcf72968eaeb72d33a8d3f4fd5 100644
--- a/ui/accelerated_widget_mac/accelerated_widget_mac.h
+++ b/ui/accelerated_widget_mac/accelerated_widget_mac.h
@@ -8,6 +8,7 @@
#include <IOSurface/IOSurface.h>
#include <vector>
+#include "base/mac/scoped_cftyperef.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/rect.h"
@@ -17,8 +18,6 @@
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#import "base/mac/scoped_nsobject.h"
-#import "ui/accelerated_widget_mac/io_surface_layer.h"
-#import "ui/accelerated_widget_mac/software_layer.h"
#include "ui/base/cocoa/remote_layer_api.h"
#endif // __OBJC__
@@ -52,8 +51,7 @@ class AcceleratedWidgetMacNSView {
// to a ui::Compositor, which will cause, through its output surface, calls to
// GotAcceleratedFrame and GotSoftwareFrame. The CALayers may be installed
// in an NSView by setting the AcceleratedWidgetMacNSView for the helper.
-class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac
- : public IOSurfaceLayerClient {
+class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac {
public:
explicit AcceleratedWidgetMac(bool needs_gl_finish_workaround);
virtual ~AcceleratedWidgetMac();
@@ -89,14 +87,12 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac
const gfx::Rect& pixel_damage_rect,
const base::Closure& drawn_callback);
- void GotSoftwareFrame(float scale_factor, SkCanvas* canvas);
+ void GotIOSurfaceFrame(base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
+ const gfx::Size& pixel_size,
+ float scale_factor,
+ bool flip_y);
private:
- // IOSurfaceLayerClient implementation:
- bool IOSurfaceLayerShouldAckImmediately() const override;
- void IOSurfaceLayerDidDrawFrame() override;
- void IOSurfaceLayerHitError() override;
-
void GotAcceleratedCAContextFrame(CAContextID ca_context_id,
const gfx::Size& pixel_size,
float scale_factor);
@@ -113,9 +109,8 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac
// layer is reset.
void DestroyCAContextLayer(
base::scoped_nsobject<CALayerHost> ca_context_layer);
- void DestroyIOSurfaceLayer(
- base::scoped_nsobject<IOSurfaceLayer> io_surface_layer);
- void DestroySoftwareLayer();
+ void DestroyLocalLayer();
+ void EnsureLocalLayer();
// The AcceleratedWidgetMacNSView that is using this as its internals.
AcceleratedWidgetMacNSView* view_;
@@ -135,11 +130,8 @@ class ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac
// The accelerated CoreAnimation layer hosted by the GPU process.
base::scoped_nsobject<CALayerHost> ca_context_layer_;
- // The locally drawn accelerated CoreAnimation layer.
- base::scoped_nsobject<IOSurfaceLayer> io_surface_layer_;
-
- // The locally drawn software layer.
- base::scoped_nsobject<SoftwareLayer> software_layer_;
+ // The locally drawn layer, which has its contents set to an IOSurface.
+ base::scoped_nsobject<CALayer> local_layer_;
// If an accelerated frame has come in which has not yet been drawn and acked
// then this is the latency info and the callback to make when the frame is
@@ -171,8 +163,12 @@ void AcceleratedWidgetMacGotAcceleratedFrame(
base::TimeTicks* vsync_timebase, base::TimeDelta* vsync_interval);
ACCELERATED_WIDGET_MAC_EXPORT
-void AcceleratedWidgetMacGotSoftwareFrame(
- gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas);
+void AcceleratedWidgetMacGotIOSurfaceFrame(
+ gfx::AcceleratedWidget widget,
+ base::ScopedCFTypeRef<IOSurfaceRef> io_surface,
+ const gfx::Size& pixel_size,
+ float scale_factor,
+ bool flip_y);
tapted 2015/10/26 02:51:42 is flip_y needed here? (i.e. would it be correct t
ccameron 2015/10/26 06:40:34 It's still needed, because accelerated IOSurfaces
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698