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

Unified Diff: ui/accelerated_widget_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: gn check 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
« no previous file with comments | « ui/accelerated_widget_mac/README ('k') | ui/accelerated_widget_mac/accelerated_widget_mac.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accelerated_widget_mac/accelerated_widget_mac.h
diff --git a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h b/ui/accelerated_widget_mac/accelerated_widget_mac.h
similarity index 83%
rename from content/browser/compositor/browser_compositor_ca_layer_tree_mac.h
rename to ui/accelerated_widget_mac/accelerated_widget_mac.h
index 34b5c977f601534cfc899abbb1e6cea6ee0754eb..bf7843369e6ca3b8d4cd6095134a4f9b4413592e 100644
--- a/content/browser/compositor/browser_compositor_ca_layer_tree_mac.h
+++ b/ui/accelerated_widget_mac/accelerated_widget_mac.h
@@ -2,30 +2,32 @@
// 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_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
+#define UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
#include <IOSurface/IOSurfaceAPI.h>
#include <vector>
-#include "skia/ext/platform_canvas.h"
+#include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#if defined(__OBJC__)
-#include <Cocoa/Cocoa.h>
-#include "base/mac/scoped_nsobject.h"
-#include "content/browser/compositor/io_surface_layer_mac.h"
-#include "content/browser/compositor/software_layer_mac.h"
+#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__
+class SkCanvas;
+
namespace cc {
class SoftwareFrameData;
}
-namespace content {
+namespace ui {
class AcceleratedWidgetMac;
@@ -47,9 +49,10 @@ 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 ACCELERATED_WIDGET_MAC_EXPORT AcceleratedWidgetMac
+ : public IOSurfaceLayerClient {
public:
- AcceleratedWidgetMac();
+ explicit AcceleratedWidgetMac(bool needs_gl_finish_workaround);
virtual ~AcceleratedWidgetMac();
gfx::AcceleratedWidget accelerated_widget() { return native_widget_; }
@@ -78,10 +81,9 @@ class AcceleratedWidgetMac : public IOSurfaceLayerClient {
float scale_factor,
const base::Closure& drawn_callback);
- void GotSoftwareFrame(
- cc::SoftwareFrameData* frame_data, float scale_factor, SkCanvas* canvas);
+ void GotSoftwareFrame(float scale_factor, SkCanvas* canvas);
-private:
+ private:
// IOSurfaceLayerClient implementation:
bool IOSurfaceLayerShouldAckImmediately() const override;
void IOSurfaceLayerDidDrawFrame() override;
@@ -138,11 +140,16 @@ private:
// The size in DIP of the last swap received from |compositor_|.
gfx::Size last_swap_size_dip_;
+ // Whether surfaces created by the widget should use the glFinish() workaround
+ // after compositing.
+ bool needs_gl_finish_workaround_;
+
DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMac);
};
#endif // __OBJC__
+ACCELERATED_WIDGET_MAC_EXPORT
void AcceleratedWidgetMacGotAcceleratedFrame(
gfx::AcceleratedWidget widget, uint64 surface_handle,
const std::vector<ui::LatencyInfo>& latency_info,
@@ -150,10 +157,10 @@ void AcceleratedWidgetMacGotAcceleratedFrame(
const base::Closure& drawn_callback,
bool* disable_throttling, int* renderer_id);
+ACCELERATED_WIDGET_MAC_EXPORT
void AcceleratedWidgetMacGotSoftwareFrame(
- gfx::AcceleratedWidget widget,
- cc::SoftwareFrameData* frame_data, float scale_factor, SkCanvas* canvas);
+ gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas);
-} // namespace content
+} // namespace ui
-#endif // CONTENT_BROWSER_COMPOSITOR_ACCELERATED_WIDGET_HELPER_MAC_H_
+#endif // UI_ACCELERATED_WIDGET_MAC_ACCELERATED_WIDGET_MAC_H_
« no previous file with comments | « ui/accelerated_widget_mac/README ('k') | ui/accelerated_widget_mac/accelerated_widget_mac.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698