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> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "ipc/ipc_sender.h" | 30 #include "ipc/ipc_sender.h" |
31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
32 #include "ui/base/cocoa/base_view.h" | 32 #include "ui/base/cocoa/base_view.h" |
33 #include "ui/base/cocoa/remote_layer_api.h" | 33 #include "ui/base/cocoa/remote_layer_api.h" |
34 #include "ui/gfx/display_observer.h" | 34 #include "ui/gfx/display_observer.h" |
35 | 35 |
36 struct ViewHostMsg_TextInputState_Params; | 36 struct ViewHostMsg_TextInputState_Params; |
37 | 37 |
38 namespace content { | 38 namespace content { |
39 class BrowserCompositorviewMac; | 39 class BrowserCompositorviewMac; |
40 class CompositingIOSurfaceMac; | |
41 class CompositingIOSurfaceContext; | |
42 class RenderWidgetHostViewMac; | 40 class RenderWidgetHostViewMac; |
43 class RenderWidgetHostViewMacEditCommandHelper; | 41 class RenderWidgetHostViewMacEditCommandHelper; |
44 class WebContents; | 42 class WebContents; |
45 } | 43 } |
46 | 44 |
47 namespace ui { | 45 namespace ui { |
48 class Compositor; | 46 class Compositor; |
49 class Layer; | 47 class Layer; |
50 } | 48 } |
51 | 49 |
52 @class CompositingIOSurfaceLayer; | |
53 @class FullscreenWindowManager; | 50 @class FullscreenWindowManager; |
54 @protocol RenderWidgetHostViewMacDelegate; | 51 @protocol RenderWidgetHostViewMacDelegate; |
55 @class SoftwareLayer; | |
56 @class ToolTip; | 52 @class ToolTip; |
57 | 53 |
58 @protocol RenderWidgetHostViewMacOwner | 54 @protocol RenderWidgetHostViewMacOwner |
59 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac; | 55 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac; |
60 @end | 56 @end |
61 | 57 |
62 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, | 58 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, |
63 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles | 59 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles |
64 // but that means that the view needs to own the delegate and will dispose of it | 60 // but that means that the view needs to own the delegate and will dispose of it |
65 // when it's removed from the view system. | 61 // when it's removed from the view system. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 144 |
149 // Whether or not plugin IME is currently enabled active. | 145 // Whether or not plugin IME is currently enabled active. |
150 BOOL pluginImeActive_; | 146 BOOL pluginImeActive_; |
151 | 147 |
152 // Whether the previous mouse event was ignored due to hitTest check. | 148 // Whether the previous mouse event was ignored due to hitTest check. |
153 BOOL mouseEventWasIgnored_; | 149 BOOL mouseEventWasIgnored_; |
154 | 150 |
155 // Event monitor for scroll wheel end event. | 151 // Event monitor for scroll wheel end event. |
156 id endWheelMonitor_; | 152 id endWheelMonitor_; |
157 | 153 |
158 // OpenGL Support: | |
159 | |
160 // recursive globalFrameDidChange protection: | |
161 BOOL handlingGlobalFrameDidChange_; | |
162 | |
163 // The scale factor of the display this view is in. | |
164 float deviceScaleFactor_; | |
165 | |
166 // If true then escape key down events are suppressed until the first escape | 154 // If true then escape key down events are suppressed until the first escape |
167 // key up event. (The up event is suppressed as well). This is used by the | 155 // key up event. (The up event is suppressed as well). This is used by the |
168 // flash fullscreen code to avoid sending a key up event without a matching | 156 // flash fullscreen code to avoid sending a key up event without a matching |
169 // key down event. | 157 // key down event. |
170 BOOL suppressNextEscapeKeyUp_; | 158 BOOL suppressNextEscapeKeyUp_; |
171 } | 159 } |
172 | 160 |
173 @property(nonatomic, readonly) NSRange selectedRange; | 161 @property(nonatomic, readonly) NSRange selectedRange; |
174 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp; | 162 @property(nonatomic, readonly) BOOL suppressNextEscapeKeyUp; |
175 | 163 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // "The lifetime of the RenderWidgetHost* is tied to the render process. | 200 // "The lifetime of the RenderWidgetHost* is tied to the render process. |
213 // If the render process dies, the RenderWidgetHost* goes away and all | 201 // If the render process dies, the RenderWidgetHost* goes away and all |
214 // references to it must become NULL." | 202 // references to it must become NULL." |
215 // | 203 // |
216 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 204 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
217 class CONTENT_EXPORT RenderWidgetHostViewMac | 205 class CONTENT_EXPORT RenderWidgetHostViewMac |
218 : public RenderWidgetHostViewBase, | 206 : public RenderWidgetHostViewBase, |
219 public DelegatedFrameHostClient, | 207 public DelegatedFrameHostClient, |
220 public BrowserCompositorViewMacClient, | 208 public BrowserCompositorViewMacClient, |
221 public IPC::Sender, | 209 public IPC::Sender, |
222 public SoftwareFrameManagerClient, | |
223 public CompositingIOSurfaceLayerClient, | 210 public CompositingIOSurfaceLayerClient, |
224 public gfx::DisplayObserver { | 211 public gfx::DisplayObserver { |
225 public: | 212 public: |
226 // The view will associate itself with the given widget. The native view must | 213 // The view will associate itself with the given widget. The native view must |
227 // be hooked up immediately to the view hierarchy, or else when it is | 214 // be hooked up immediately to the view hierarchy, or else when it is |
228 // deleted it will delete this out from under the caller. | 215 // deleted it will delete this out from under the caller. |
229 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); | 216 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); |
230 virtual ~RenderWidgetHostViewMac(); | 217 virtual ~RenderWidgetHostViewMac(); |
231 | 218 |
232 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } | 219 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 321 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
335 | 322 |
336 virtual bool LockMouse() OVERRIDE; | 323 virtual bool LockMouse() OVERRIDE; |
337 virtual void UnlockMouse() OVERRIDE; | 324 virtual void UnlockMouse() OVERRIDE; |
338 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, | 325 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, |
339 InputEventAckState ack_result) OVERRIDE; | 326 InputEventAckState ack_result) OVERRIDE; |
340 | 327 |
341 // IPC::Sender implementation. | 328 // IPC::Sender implementation. |
342 virtual bool Send(IPC::Message* message) OVERRIDE; | 329 virtual bool Send(IPC::Message* message) OVERRIDE; |
343 | 330 |
344 // SoftwareFrameManagerClient implementation: | |
345 virtual void SoftwareFrameWasFreed( | |
346 uint32 output_surface_id, unsigned frame_id) OVERRIDE; | |
347 virtual void ReleaseReferencesToSoftwareFrame() OVERRIDE; | |
348 | |
349 virtual SkColorType PreferredReadbackFormat() OVERRIDE; | 331 virtual SkColorType PreferredReadbackFormat() OVERRIDE; |
350 | 332 |
351 // CompositingIOSurfaceLayerClient implementation. | 333 // CompositingIOSurfaceLayerClient implementation. |
352 virtual bool AcceleratedLayerShouldAckImmediately() const OVERRIDE; | 334 virtual bool AcceleratedLayerShouldAckImmediately() const OVERRIDE; |
353 virtual void AcceleratedLayerDidDrawFrame() OVERRIDE; | 335 virtual void AcceleratedLayerDidDrawFrame() OVERRIDE; |
354 virtual void AcceleratedLayerHitError() OVERRIDE; | 336 virtual void AcceleratedLayerHitError() OVERRIDE; |
355 | 337 |
356 // gfx::DisplayObserver implementation. | 338 // gfx::DisplayObserver implementation. |
357 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 339 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
358 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 340 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
359 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 341 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
360 uint32_t metrics) OVERRIDE; | 342 uint32_t metrics) OVERRIDE; |
361 | 343 |
362 // Forwards the mouse event to the renderer. | 344 // Forwards the mouse event to the renderer. |
363 void ForwardMouseEvent(const blink::WebMouseEvent& event); | 345 void ForwardMouseEvent(const blink::WebMouseEvent& event); |
364 | 346 |
365 void KillSelf(); | 347 void KillSelf(); |
366 | 348 |
367 void SetTextInputActive(bool active); | 349 void SetTextInputActive(bool active); |
368 | 350 |
369 // Sends completed plugin IME notification and text back to the renderer. | 351 // Sends completed plugin IME notification and text back to the renderer. |
370 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); | 352 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); |
371 | 353 |
372 const std::string& selected_text() const { return selected_text_; } | 354 const std::string& selected_text() const { return selected_text_; } |
373 | 355 |
374 // Update the IOSurface to be drawn and call setNeedsDisplay on | |
375 // |cocoa_view_|. | |
376 void CompositorSwapBuffers(IOSurfaceID surface_handle, | |
377 const gfx::Rect& damage_rect, | |
378 const gfx::Size& surface_size, | |
379 float scale_factor, | |
380 const std::vector<ui::LatencyInfo>& latency_info); | |
381 | |
382 // Called when a GPU error is detected. Posts a task to destroy all | |
383 // compositing state. | |
384 void GotAcceleratedCompositingError(); | |
385 | |
386 // Returns true and stores first rectangle for character range if the | 356 // Returns true and stores first rectangle for character range if the |
387 // requested |range| is already cached, otherwise returns false. | 357 // requested |range| is already cached, otherwise returns false. |
388 // Exposed for testing. | 358 // Exposed for testing. |
389 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( | 359 CONTENT_EXPORT bool GetCachedFirstRectForCharacterRange( |
390 NSRange range, NSRect* rect, NSRange* actual_range); | 360 NSRange range, NSRect* rect, NSRange* actual_range); |
391 | 361 |
392 // Returns true if there is line break in |range| and stores line breaking | 362 // Returns true if there is line break in |range| and stores line breaking |
393 // point to |line_breaking_point|. The |line_break_point| is valid only if | 363 // point to |line_breaking_point|. The |line_break_point| is valid only if |
394 // this function returns true. | 364 // this function returns true. |
395 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, | 365 bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds, |
(...skipping 20 matching lines...) Expand all Loading... |
416 // someone (other than superview) has retained |cocoa_view_|. | 386 // someone (other than superview) has retained |cocoa_view_|. |
417 RenderWidgetHostImpl* render_widget_host_; | 387 RenderWidgetHostImpl* render_widget_host_; |
418 | 388 |
419 // Current text input type. | 389 // Current text input type. |
420 ui::TextInputType text_input_type_; | 390 ui::TextInputType text_input_type_; |
421 bool can_compose_inline_; | 391 bool can_compose_inline_; |
422 | 392 |
423 // The background CoreAnimation layer which is hosted by |cocoa_view_|. | 393 // The background CoreAnimation layer which is hosted by |cocoa_view_|. |
424 base::scoped_nsobject<CALayer> background_layer_; | 394 base::scoped_nsobject<CALayer> background_layer_; |
425 | 395 |
426 // A flipped layer, which acts as the parent of the compositing and software | |
427 // layers. This layer is flipped so that the we don't need to recompute the | |
428 // origin for sub-layers when their position changes (this is impossible when | |
429 // using remote layers, as their size change cannot be synchronized with the | |
430 // window). This indirection is needed because flipping hosted layers (like | |
431 // |background_layer_|) leads to unpredictable behavior. | |
432 base::scoped_nsobject<CALayer> flipped_layer_; | |
433 | |
434 // The CoreAnimation layer hosted by the GPU process. | |
435 base::scoped_nsobject<CALayerHost> remote_layer_host_; | |
436 | |
437 // The CoreAnimation layer for software compositing. This should be NULL | |
438 // when software compositing is not in use. | |
439 base::scoped_nsobject<SoftwareLayer> software_layer_; | |
440 | |
441 // Accelerated compositing structures. These may be dynamically created and | |
442 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. | |
443 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; | |
444 scoped_refptr<CompositingIOSurfaceMac> compositing_iosurface_; | |
445 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; | |
446 | |
447 // Delegated frame management and compositior. | 396 // Delegated frame management and compositior. |
448 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; | 397 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; |
449 scoped_ptr<ui::Layer> root_layer_; | 398 scoped_ptr<ui::Layer> root_layer_; |
450 | 399 |
451 // Container for the NSView drawn by the browser compositor. | 400 // Container for the NSView drawn by the browser compositor. |
452 scoped_ptr<BrowserCompositorViewMac> browser_compositor_view_; | 401 scoped_ptr<BrowserCompositorViewMac> browser_compositor_view_; |
453 | 402 |
454 // Placeholder that is allocated while browser_compositor_view_ is NULL, | 403 // Placeholder that is allocated while browser_compositor_view_ is NULL, |
455 // indicating that a BrowserCompositorViewMac may be allocated. This is to | 404 // indicating that a BrowserCompositorViewMac may be allocated. This is to |
456 // help in recycling the internals of BrowserCompositorViewMac. | 405 // help in recycling the internals of BrowserCompositorViewMac. |
457 scoped_ptr<BrowserCompositorViewPlaceholderMac> | 406 scoped_ptr<BrowserCompositorViewPlaceholderMac> |
458 browser_compositor_view_placeholder_; | 407 browser_compositor_view_placeholder_; |
459 | 408 |
460 // This holds the current software compositing framebuffer, if any. | |
461 scoped_ptr<SoftwareFrameManager> software_frame_manager_; | |
462 | |
463 // Latency info to send back when the next frame appears on the | |
464 // screen. | |
465 std::vector<ui::LatencyInfo> pending_latency_info_; | |
466 | |
467 NSWindow* pepper_fullscreen_window() const { | 409 NSWindow* pepper_fullscreen_window() const { |
468 return pepper_fullscreen_window_; | 410 return pepper_fullscreen_window_; |
469 } | 411 } |
470 | 412 |
471 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing(); | 413 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing(); |
472 | 414 |
473 RenderWidgetHostViewMac* fullscreen_parent_host_view() const { | 415 RenderWidgetHostViewMac* fullscreen_parent_host_view() const { |
474 return fullscreen_parent_host_view_; | 416 return fullscreen_parent_host_view_; |
475 } | 417 } |
476 | 418 |
477 RenderWidgetHostViewFrameSubscriber* frame_subscriber() const { | |
478 return frame_subscriber_.get(); | |
479 } | |
480 | |
481 int window_number() const; | 419 int window_number() const; |
482 | 420 |
483 // The scale factor for the screen that the view is currently on. | 421 // The scale factor for the screen that the view is currently on. |
484 float ViewScaleFactor() const; | 422 float ViewScaleFactor() const; |
485 | 423 |
486 // Update the scale factor for the backing store and for any CALayers. | 424 // Update the scale factor for the backing store and for any CALayers. |
487 void UpdateBackingStoreScaleFactor(); | 425 void UpdateBackingStoreScaleFactor(); |
488 | 426 |
489 // Ensure that the display link is associated with the correct display. | 427 // Ensure that the display link is associated with the correct display. |
490 void UpdateDisplayLink(); | 428 void UpdateDisplayLink(); |
491 | 429 |
492 // The scale factor of the backing store. Note that this is updated based on | |
493 // ViewScaleFactor with some delay. | |
494 float backing_store_scale_factor_; | |
495 | |
496 void AddPendingLatencyInfo( | |
497 const std::vector<ui::LatencyInfo>& latency_info); | |
498 void SendPendingLatencyInfoToHost(); | |
499 | |
500 void SendPendingSwapAck(); | |
501 | |
502 void PauseForPendingResizeOrRepaintsAndDraw(); | 430 void PauseForPendingResizeOrRepaintsAndDraw(); |
503 | 431 |
504 // The geometric arrangement of the layers depends on cocoa_view's size, the | |
505 // compositing IOSurface's rounded size, and the software frame size. Update | |
506 // all of them using this function when any of those parameters changes. Also | |
507 // update the scale factor of the layers. | |
508 void LayoutLayers(); | |
509 | |
510 // DelegatedFrameHostClient implementation. | 432 // DelegatedFrameHostClient implementation. |
511 virtual ui::Compositor* GetCompositor() const OVERRIDE; | 433 virtual ui::Compositor* GetCompositor() const OVERRIDE; |
512 virtual ui::Layer* GetLayer() OVERRIDE; | 434 virtual ui::Layer* GetLayer() OVERRIDE; |
513 virtual RenderWidgetHostImpl* GetHost() OVERRIDE; | 435 virtual RenderWidgetHostImpl* GetHost() OVERRIDE; |
514 virtual void SchedulePaintInRect( | 436 virtual void SchedulePaintInRect( |
515 const gfx::Rect& damage_rect_in_dip) OVERRIDE; | 437 const gfx::Rect& damage_rect_in_dip) OVERRIDE; |
516 virtual bool IsVisible() OVERRIDE; | 438 virtual bool IsVisible() OVERRIDE; |
517 virtual scoped_ptr<ResizeLock> CreateResizeLock( | 439 virtual scoped_ptr<ResizeLock> CreateResizeLock( |
518 bool defer_compositor_lock) OVERRIDE; | 440 bool defer_compositor_lock) OVERRIDE; |
519 virtual gfx::Size DesiredFrameSize() OVERRIDE; | 441 virtual gfx::Size DesiredFrameSize() OVERRIDE; |
520 virtual float CurrentDeviceScaleFactor() OVERRIDE; | 442 virtual float CurrentDeviceScaleFactor() OVERRIDE; |
521 virtual gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) OVERRIDE; | 443 virtual gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) OVERRIDE; |
522 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE; | 444 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE; |
523 | 445 |
524 // BrowserCompositorViewMacClient implementation. | 446 // BrowserCompositorViewMacClient implementation. |
525 virtual bool BrowserCompositorViewShouldAckImmediately() const OVERRIDE; | 447 virtual bool BrowserCompositorViewShouldAckImmediately() const OVERRIDE; |
526 virtual void BrowserCompositorViewFrameSwapped( | 448 virtual void BrowserCompositorViewFrameSwapped( |
527 const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE; | 449 const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE; |
528 virtual NSView* BrowserCompositorSuperview() OVERRIDE; | 450 virtual NSView* BrowserCompositorSuperview() OVERRIDE; |
529 virtual ui::Layer* BrowserCompositorRootLayer() OVERRIDE; | 451 virtual ui::Layer* BrowserCompositorRootLayer() OVERRIDE; |
530 | 452 |
531 private: | 453 private: |
532 friend class RenderWidgetHostViewMacTest; | 454 friend class RenderWidgetHostViewMacTest; |
533 | 455 |
534 struct PendingSwapAck { | |
535 PendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id) | |
536 : route_id(route_id), | |
537 gpu_host_id(gpu_host_id), | |
538 renderer_id(renderer_id) {} | |
539 int32 route_id; | |
540 int gpu_host_id; | |
541 int32 renderer_id; | |
542 }; | |
543 scoped_ptr<PendingSwapAck> pending_swap_ack_; | |
544 void AddPendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id); | |
545 | |
546 // Returns whether this render view is a popup (autocomplete window). | 456 // Returns whether this render view is a popup (autocomplete window). |
547 bool IsPopup() const; | 457 bool IsPopup() const; |
548 | 458 |
549 // Shuts down the render_widget_host_. This is a separate function so we can | 459 // Shuts down the render_widget_host_. This is a separate function so we can |
550 // invoke it from the message loop. | 460 // invoke it from the message loop. |
551 void ShutdownHost(); | 461 void ShutdownHost(); |
552 | 462 |
553 // Tear down all components of the browser compositor in an order that will | 463 // Tear down all components of the browser compositor in an order that will |
554 // ensure no dangling references. | 464 // ensure no dangling references. |
555 void ShutdownBrowserCompositor(); | 465 void ShutdownBrowserCompositor(); |
556 | 466 |
557 void EnsureBrowserCompositorView(); | 467 void EnsureBrowserCompositorView(); |
558 void DestroyBrowserCompositorView(); | 468 void DestroyBrowserCompositorView(); |
559 | 469 |
560 void EnsureSoftwareLayer(); | |
561 void DestroySoftwareLayer(); | |
562 | |
563 bool EnsureCompositedIOSurface() WARN_UNUSED_RESULT; | |
564 void EnsureCompositedIOSurfaceLayer(); | |
565 enum DestroyCompositedIOSurfaceLayerBehavior { | |
566 kLeaveLayerInHierarchy, | |
567 kRemoveLayerFromHierarchy, | |
568 }; | |
569 void DestroyCompositedIOSurfaceLayer( | |
570 DestroyCompositedIOSurfaceLayerBehavior destroy_layer_behavior); | |
571 void DestroyCompositedIOSurfaceAndLayer(); | |
572 | |
573 void DestroyCompositingStateOnError(); | |
574 | |
575 // Called when a GPU SwapBuffers is received. | |
576 void GotAcceleratedFrame(); | |
577 | |
578 // Called when a software DIB is received. | |
579 void GotSoftwareFrame(); | |
580 | |
581 // IPC message handlers. | 470 // IPC message handlers. |
582 void OnPluginFocusChanged(bool focused, int plugin_id); | 471 void OnPluginFocusChanged(bool focused, int plugin_id); |
583 void OnStartPluginIme(); | 472 void OnStartPluginIme(); |
584 void OnGetRenderedTextCompleted(const std::string& text); | 473 void OnGetRenderedTextCompleted(const std::string& text); |
585 | 474 |
586 // Convert |rect| from the views coordinate (upper-left origin) into | |
587 // the OpenGL coordinate (lower-left origin) and scale for HiDPI displays. | |
588 gfx::Rect GetScaledOpenGLPixelRect(const gfx::Rect& rect); | |
589 | |
590 // Send updated vsync parameters to the renderer. | 475 // Send updated vsync parameters to the renderer. |
591 void SendVSyncParametersToRenderer(); | 476 void SendVSyncParametersToRenderer(); |
592 | 477 |
593 // Dispatches a TTS session. | 478 // Dispatches a TTS session. |
594 void SpeakText(const std::string& text); | 479 void SpeakText(const std::string& text); |
595 | 480 |
596 // The associated view. This is weak and is inserted into the view hierarchy | 481 // The associated view. This is weak and is inserted into the view hierarchy |
597 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the | 482 // to own this RenderWidgetHostViewMac object. Set to nil at the start of the |
598 // destructor. | 483 // destructor. |
599 RenderWidgetHostViewCocoa* cocoa_view_; | 484 RenderWidgetHostViewCocoa* cocoa_view_; |
(...skipping 30 matching lines...) Expand all Loading... |
630 base::TimeTicks vsync_timebase_; | 515 base::TimeTicks vsync_timebase_; |
631 base::TimeDelta vsync_interval_; | 516 base::TimeDelta vsync_interval_; |
632 | 517 |
633 // The current composition character range and its bounds. | 518 // The current composition character range and its bounds. |
634 gfx::Range composition_range_; | 519 gfx::Range composition_range_; |
635 std::vector<gfx::Rect> composition_bounds_; | 520 std::vector<gfx::Rect> composition_bounds_; |
636 | 521 |
637 // The current caret bounds. | 522 // The current caret bounds. |
638 gfx::Rect caret_rect_; | 523 gfx::Rect caret_rect_; |
639 | 524 |
640 // Subscriber that listens to frame presentation events. | |
641 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | |
642 | |
643 base::WeakPtrFactory<RenderWidgetHostViewMac> | |
644 software_frame_weak_ptr_factory_; | |
645 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 525 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
646 }; | 526 }; |
647 | 527 |
648 } // namespace content | 528 } // namespace content |
649 | 529 |
650 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 530 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |