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

Unified Diff: ui/compositor/mac/accelerated_widget_mac.h

Issue 753933002: MacViews: Move content::AcceleratedWidget to new component, ui/accelerated_widget_mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20141124-MacViews-MoveSoftwareLayerMac-fromcl
Patch Set: nit DEPS, deps and gn Created 6 years, 1 month 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/compositor/mac/accelerated_widget_mac.h
diff --git a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h b/ui/compositor/mac/accelerated_widget_mac.h
similarity index 90%
rename from content/browser/compositor/browser_compositor_ca_layer_tree_mac.h
rename to ui/compositor/mac/accelerated_widget_mac.h
index 7475794a57c0648bf0b663ecd4f5923b3fd92138..294fd6a145e6d655bd438b018320a60bdca7e8a2 100644
--- a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h
+++ b/ui/compositor/mac/accelerated_widget_mac.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_COMPOSITOR_ACCELERATED_WIDGET_HELPER_MAC_H_
-#define CONTENT_BROWSER_COMPOSITOR_ACCELERATED_WIDGET_HELPER_MAC_H_
+#ifndef UI_COMPOSITOR_MAC_ACCELERATED_WIDGET_HELPER_MAC_H_
+#define UI_COMPOSITOR_MAC_ACCELERATED_WIDGET_HELPER_MAC_H_
#include <IOSurface/IOSurfaceAPI.h>
#include <vector>
-#include "skia/ext/platform_canvas.h"
+#include "ui/compositor/compositor_export.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
@@ -16,15 +16,18 @@
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#import "base/mac/scoped_nsobject.h"
-#import "content/browser/compositor/io_surface_layer_mac.h"
#include "ui/base/cocoa/remote_layer_api.h"
ccameron 2014/11/25 17:54:25 I'd prefer for software_layer to live in ui/compos
tapted 2014/11/25 23:53:55 Done. There was an earlier objection to it being i
#import "ui/base/cocoa/software_layer.h"
+#import "ui/compositor/mac/io_surface_layer_mac.h"
#endif // __OBJC__
+class SkCanvas;
+
namespace cc {
class SoftwareFrameData;
}
+// TODO(tapted): Move this out of content namespace.
ccameron 2014/11/25 17:54:25 I'd prefer to move this stuff to ui:: in this patc
tapted 2014/11/25 23:53:55 Done. (with ui:: for now so you can see how it loo
namespace content {
class AcceleratedWidgetMac;
@@ -36,6 +39,7 @@ class AcceleratedWidgetMacNSView {
public:
virtual NSView* AcceleratedWidgetGetNSView() const = 0;
virtual bool AcceleratedWidgetShouldIgnoreBackpressure() const = 0;
+ virtual bool AcceleratedWidgetNeedsGLFinishWorkaround() const = 0;
virtual void AcceleratedWidgetSwapCompleted(
const std::vector<ui::LatencyInfo>& latency_info) = 0;
virtual void AcceleratedWidgetHitError() = 0;
@@ -47,7 +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 AcceleratedWidgetMac : public IOSurfaceLayerClient {
+class COMPOSITOR_EXPORT AcceleratedWidgetMac : public IOSurfaceLayerClient {
public:
AcceleratedWidgetMac();
virtual ~AcceleratedWidgetMac();
@@ -84,6 +88,7 @@ class AcceleratedWidgetMac : public IOSurfaceLayerClient {
private:
// IOSurfaceLayerClient implementation:
bool IOSurfaceLayerShouldAckImmediately() const override;
+ bool IOSurfaceNeedsGLFinishWorkaround() const override;
void IOSurfaceLayerDidDrawFrame() override;
void IOSurfaceLayerHitError() override;
@@ -143,6 +148,7 @@ private:
#endif // __OBJC__
+COMPOSITOR_EXPORT
void AcceleratedWidgetMacGotAcceleratedFrame(
gfx::AcceleratedWidget widget, uint64 surface_handle,
const std::vector<ui::LatencyInfo>& latency_info,
@@ -150,10 +156,11 @@ void AcceleratedWidgetMacGotAcceleratedFrame(
const base::Closure& drawn_callback,
bool* disable_throttling, int* renderer_id);
+COMPOSITOR_EXPORT
void AcceleratedWidgetMacGotSoftwareFrame(
gfx::AcceleratedWidget widget,
cc::SoftwareFrameData* frame_data, float scale_factor, SkCanvas* canvas);
} // namespace content
-#endif // CONTENT_BROWSER_COMPOSITOR_ACCELERATED_WIDGET_HELPER_MAC_H_
+#endif // UI_COMPOSITOR_MAC_ACCELERATED_WIDGET_HELPER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698