OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <IOSurface/IOSurfaceAPI.h> | 9 #include <IOSurface/IOSurfaceAPI.h> |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/mac/scoped_nsobject.h" | 16 #include "base/mac/scoped_nsobject.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "content/browser/compositor/browser_compositor_ca_layer_tree_mac.h" | |
21 #include "content/browser/compositor/browser_compositor_view_mac.h" | 20 #include "content/browser/compositor/browser_compositor_view_mac.h" |
22 #include "content/browser/compositor/delegated_frame_host.h" | 21 #include "content/browser/compositor/delegated_frame_host.h" |
23 #include "content/browser/compositor/io_surface_layer_mac.h" | |
24 #include "content/browser/renderer_host/display_link_mac.h" | 22 #include "content/browser/renderer_host/display_link_mac.h" |
25 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
26 #include "content/browser/renderer_host/software_frame_manager.h" | 24 #include "content/browser/renderer_host/software_frame_manager.h" |
27 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
28 #include "content/common/cursors/webcursor.h" | 26 #include "content/common/cursors/webcursor.h" |
29 #include "content/common/edit_command.h" | 27 #include "content/common/edit_command.h" |
30 #import "content/public/browser/render_widget_host_view_mac_base.h" | 28 #import "content/public/browser/render_widget_host_view_mac_base.h" |
31 #include "ipc/ipc_sender.h" | 29 #include "ipc/ipc_sender.h" |
32 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 30 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
33 #include "ui/base/cocoa/base_view.h" | 31 #include "ui/base/cocoa/base_view.h" |
34 #include "ui/base/cocoa/remote_layer_api.h" | 32 #include "ui/base/cocoa/remote_layer_api.h" |
| 33 #include "ui/compositor/mac/accelerated_widget_mac.h" |
| 34 #include "ui/compositor/mac/io_surface_layer_mac.h" |
35 #include "ui/gfx/display_observer.h" | 35 #include "ui/gfx/display_observer.h" |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 class RenderWidgetHostViewMac; | 38 class RenderWidgetHostViewMac; |
39 class RenderWidgetHostViewMacEditCommandHelper; | 39 class RenderWidgetHostViewMacEditCommandHelper; |
40 class WebContents; | 40 class WebContents; |
41 } | 41 } |
42 | 42 |
43 namespace ui { | 43 namespace ui { |
44 class Compositor; | 44 class Compositor; |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 bool IsVisible() override; | 455 bool IsVisible() override; |
456 scoped_ptr<ResizeLock> CreateResizeLock(bool defer_compositor_lock) override; | 456 scoped_ptr<ResizeLock> CreateResizeLock(bool defer_compositor_lock) override; |
457 gfx::Size DesiredFrameSize() override; | 457 gfx::Size DesiredFrameSize() override; |
458 float CurrentDeviceScaleFactor() override; | 458 float CurrentDeviceScaleFactor() override; |
459 gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) override; | 459 gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) override; |
460 DelegatedFrameHost* GetDelegatedFrameHost() const override; | 460 DelegatedFrameHost* GetDelegatedFrameHost() const override; |
461 | 461 |
462 // AcceleratedWidgetMacNSView implementation. | 462 // AcceleratedWidgetMacNSView implementation. |
463 NSView* AcceleratedWidgetGetNSView() const override; | 463 NSView* AcceleratedWidgetGetNSView() const override; |
464 bool AcceleratedWidgetShouldIgnoreBackpressure() const override; | 464 bool AcceleratedWidgetShouldIgnoreBackpressure() const override; |
| 465 bool AcceleratedWidgetNeedsGLFinishWorkaround() const override; |
465 void AcceleratedWidgetSwapCompleted( | 466 void AcceleratedWidgetSwapCompleted( |
466 const std::vector<ui::LatencyInfo>& latency_info) override; | 467 const std::vector<ui::LatencyInfo>& latency_info) override; |
467 void AcceleratedWidgetHitError() override; | 468 void AcceleratedWidgetHitError() override; |
468 | 469 |
469 // Transition from being in the Suspended state to being in the Destroyed | 470 // Transition from being in the Suspended state to being in the Destroyed |
470 // state, if appropriate (see BrowserCompositorViewState for details). | 471 // state, if appropriate (see BrowserCompositorViewState for details). |
471 void DestroySuspendedBrowserCompositorViewIfNeeded(); | 472 void DestroySuspendedBrowserCompositorViewIfNeeded(); |
472 | 473 |
473 private: | 474 private: |
474 friend class RenderWidgetHostViewMacTest; | 475 friend class RenderWidgetHostViewMacTest; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 552 |
552 // The current caret bounds. | 553 // The current caret bounds. |
553 gfx::Rect caret_rect_; | 554 gfx::Rect caret_rect_; |
554 | 555 |
555 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 556 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
556 }; | 557 }; |
557 | 558 |
558 } // namespace content | 559 } // namespace content |
559 | 560 |
560 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 561 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |