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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 311263003: Delete non-CoreAnimation code in RWHVMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swappressure
Patch Set: Update driver bug Created 6 years, 6 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 unified diff | Download patch
OLDNEW
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 <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 const std::string& selected_text() const { return selected_text_; } 364 const std::string& selected_text() const { return selected_text_; }
365 365
366 // Update the IOSurface to be drawn and call setNeedsDisplay on 366 // Update the IOSurface to be drawn and call setNeedsDisplay on
367 // |cocoa_view_|. 367 // |cocoa_view_|.
368 void CompositorSwapBuffers(uint64 surface_handle, 368 void CompositorSwapBuffers(uint64 surface_handle,
369 const gfx::Size& size, 369 const gfx::Size& size,
370 float scale_factor, 370 float scale_factor,
371 const std::vector<ui::LatencyInfo>& latency_info); 371 const std::vector<ui::LatencyInfo>& latency_info);
372 372
373 // Draw the IOSurface by making its context current to this view.
374 void DrawIOSurfaceWithoutCoreAnimation();
375
376 // Called when a GPU error is detected. Posts a task to destroy all 373 // Called when a GPU error is detected. Posts a task to destroy all
377 // compositing state. 374 // compositing state.
378 void GotAcceleratedCompositingError(); 375 void GotAcceleratedCompositingError();
379 376
380 // Sets the overlay view, which should be drawn in the same IOSurface 377 // Sets the overlay view, which should be drawn in the same IOSurface
381 // atop of this view, if both views are drawing accelerated content. 378 // atop of this view, if both views are drawing accelerated content.
382 // Overlay is stored as a weak ptr. 379 // Overlay is stored as a weak ptr.
383 void SetOverlayView(RenderWidgetHostViewMac* overlay, 380 void SetOverlayView(RenderWidgetHostViewMac* overlay,
384 const gfx::Point& offset); 381 const gfx::Point& offset);
385 382
(...skipping 26 matching lines...) Expand all
412 409
413 WebContents* GetWebContents(); 410 WebContents* GetWebContents();
414 411
415 // These member variables should be private, but the associated ObjC class 412 // These member variables should be private, but the associated ObjC class
416 // needs access to them and can't be made a friend. 413 // needs access to them and can't be made a friend.
417 414
418 // The associated Model. Can be NULL if Destroy() is called when 415 // The associated Model. Can be NULL if Destroy() is called when
419 // someone (other than superview) has retained |cocoa_view_|. 416 // someone (other than superview) has retained |cocoa_view_|.
420 RenderWidgetHostImpl* render_widget_host_; 417 RenderWidgetHostImpl* render_widget_host_;
421 418
422 // Whether last rendered frame was accelerated.
423 bool last_frame_was_accelerated_;
424
425 // The time at which this view started displaying white pixels as a result of
426 // not having anything to paint (empty backing store from renderer). This
427 // value returns true for is_null() if we are not recording whiteout times.
428 base::TimeTicks whiteout_start_time_;
429
430 // The time it took after this view was selected for it to be fully painted.
431 base::TimeTicks web_contents_switch_paint_time_;
432
433 // Current text input type. 419 // Current text input type.
434 ui::TextInputType text_input_type_; 420 ui::TextInputType text_input_type_;
435 bool can_compose_inline_; 421 bool can_compose_inline_;
436 422
437 // The background CoreAnimation layer which is hosted by |cocoa_view_|. 423 // The background CoreAnimation layer which is hosted by |cocoa_view_|.
438 // The compositing or software layers will be added as sublayers to this. 424 // The compositing or software layers will be added as sublayers to this.
439 base::scoped_nsobject<CALayer> background_layer_; 425 base::scoped_nsobject<CALayer> background_layer_;
440 426
441 // The CoreAnimation layer for software compositing. This should be NULL 427 // The CoreAnimation layer for software compositing. This should be NULL
442 // when software compositing is not in use. 428 // when software compositing is not in use.
(...skipping 12 matching lines...) Expand all
455 441
456 // This lock is taken when the browser compositor produces a frame, and is 442 // This lock is taken when the browser compositor produces a frame, and is
457 // released when that frame is displayed. It is by this mechanism that the 443 // released when that frame is displayed. It is by this mechanism that the
458 // browser compositor can exert GPU backpressure on the renderer compositor. 444 // browser compositor can exert GPU backpressure on the renderer compositor.
459 scoped_refptr<ui::CompositorLock> browser_compositor_lock_; 445 scoped_refptr<ui::CompositorLock> browser_compositor_lock_;
460 bool browser_compositor_damaged_during_lock_; 446 bool browser_compositor_damaged_during_lock_;
461 447
462 // This holds the current software compositing framebuffer, if any. 448 // This holds the current software compositing framebuffer, if any.
463 scoped_ptr<SoftwareFrameManager> software_frame_manager_; 449 scoped_ptr<SoftwareFrameManager> software_frame_manager_;
464 450
465 // Whether to allow overlapping views.
466 bool allow_overlapping_views_;
467
468 // Whether to use the CoreAnimation path to draw content.
469 bool use_core_animation_;
470
471 // Latency info to send back when the next frame appears on the 451 // Latency info to send back when the next frame appears on the
472 // screen. 452 // screen.
473 std::vector<ui::LatencyInfo> pending_latency_info_; 453 std::vector<ui::LatencyInfo> pending_latency_info_;
474 454
475 // When taking a screenshot when using CoreAnimation, add a delay of 455 // When taking a screenshot when using CoreAnimation, add a delay of
476 // a few frames to ensure that the contents have reached the screen 456 // a few frames to ensure that the contents have reached the screen
477 // before reporting latency info. 457 // before reporting latency info.
478 uint32 pending_latency_info_delay_; 458 uint32 pending_latency_info_delay_;
479 base::WeakPtrFactory<RenderWidgetHostViewMac> 459 base::WeakPtrFactory<RenderWidgetHostViewMac>
480 pending_latency_info_delay_weak_ptr_factory_; 460 pending_latency_info_delay_weak_ptr_factory_;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void DestroySoftwareLayer(); 545 void DestroySoftwareLayer();
566 546
567 bool EnsureCompositedIOSurface() WARN_UNUSED_RESULT; 547 bool EnsureCompositedIOSurface() WARN_UNUSED_RESULT;
568 void EnsureCompositedIOSurfaceLayer(); 548 void EnsureCompositedIOSurfaceLayer();
569 enum DestroyCompositedIOSurfaceLayerBehavior { 549 enum DestroyCompositedIOSurfaceLayerBehavior {
570 kLeaveLayerInHierarchy, 550 kLeaveLayerInHierarchy,
571 kRemoveLayerFromHierarchy, 551 kRemoveLayerFromHierarchy,
572 }; 552 };
573 void DestroyCompositedIOSurfaceLayer( 553 void DestroyCompositedIOSurfaceLayer(
574 DestroyCompositedIOSurfaceLayerBehavior destroy_layer_behavior); 554 DestroyCompositedIOSurfaceLayerBehavior destroy_layer_behavior);
575 enum DestroyContextBehavior { 555 void DestroyCompositedIOSurfaceAndLayer();
576 kLeaveContextBoundToView,
577 kDestroyContext,
578 };
579 void DestroyCompositedIOSurfaceAndLayer(
580 DestroyContextBehavior destroy_context_behavior);
581 556
582 void DestroyCompositingStateOnError(); 557 void DestroyCompositingStateOnError();
583 558
584 // Unbind the GL context (if any) that is bound to |cocoa_view_|.
585 void ClearBoundContextDrawable();
586
587 // Called when a GPU SwapBuffers is received. 559 // Called when a GPU SwapBuffers is received.
588 void GotAcceleratedFrame(); 560 void GotAcceleratedFrame();
589 561
590 // Called when a software DIB is received. 562 // Called when a software DIB is received.
591 void GotSoftwareFrame(); 563 void GotSoftwareFrame();
592 564
593 // IPC message handlers. 565 // IPC message handlers.
594 void OnPluginFocusChanged(bool focused, int plugin_id); 566 void OnPluginFocusChanged(bool focused, int plugin_id);
595 void OnStartPluginIme(); 567 void OnStartPluginIme();
596 void OnDidChangeScrollbarsForMainFrame(bool has_horizontal_scrollbar, 568 void OnDidChangeScrollbarsForMainFrame(bool has_horizontal_scrollbar,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 base::scoped_nsobject<NSWindow> pepper_fullscreen_window_; 605 base::scoped_nsobject<NSWindow> pepper_fullscreen_window_;
634 base::scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_; 606 base::scoped_nsobject<FullscreenWindowManager> fullscreen_window_manager_;
635 // Our parent host view, if this is fullscreen. NULL otherwise. 607 // Our parent host view, if this is fullscreen. NULL otherwise.
636 RenderWidgetHostViewMac* fullscreen_parent_host_view_; 608 RenderWidgetHostViewMac* fullscreen_parent_host_view_;
637 609
638 // The overlay view which is rendered above this one in the same 610 // The overlay view which is rendered above this one in the same
639 // accelerated IOSurface. 611 // accelerated IOSurface.
640 // Overlay view has |underlay_view_| set to this view. 612 // Overlay view has |underlay_view_| set to this view.
641 base::WeakPtr<RenderWidgetHostViewMac> overlay_view_; 613 base::WeakPtr<RenderWidgetHostViewMac> overlay_view_;
642 614
643 // Offset at which overlay view should be rendered.
644 gfx::Point overlay_view_offset_;
645
646 // The underlay view which this view is rendered above in the same 615 // The underlay view which this view is rendered above in the same
647 // accelerated IOSurface. 616 // accelerated IOSurface.
648 // Underlay view has |overlay_view_| set to this view. 617 // Underlay view has |overlay_view_| set to this view.
649 base::WeakPtr<RenderWidgetHostViewMac> underlay_view_; 618 base::WeakPtr<RenderWidgetHostViewMac> underlay_view_;
650 619
651 // Set to true when |underlay_view_| has drawn this view. After that point,
652 // this view should not draw again until |underlay_view_| is changed.
653 bool underlay_view_has_drawn_;
654
655 // Factory used to safely reference overlay view set in SetOverlayView. 620 // Factory used to safely reference overlay view set in SetOverlayView.
656 base::WeakPtrFactory<RenderWidgetHostViewMac> 621 base::WeakPtrFactory<RenderWidgetHostViewMac>
657 overlay_view_weak_factory_; 622 overlay_view_weak_factory_;
658 623
659 // Display link for getting vsync info. 624 // Display link for getting vsync info.
660 scoped_refptr<DisplayLinkMac> display_link_; 625 scoped_refptr<DisplayLinkMac> display_link_;
661 626
662 // The current composition character range and its bounds. 627 // The current composition character range and its bounds.
663 gfx::Range composition_range_; 628 gfx::Range composition_range_;
664 std::vector<gfx::Rect> composition_bounds_; 629 std::vector<gfx::Rect> composition_bounds_;
665 630
666 // The current caret bounds. 631 // The current caret bounds.
667 gfx::Rect caret_rect_; 632 gfx::Rect caret_rect_;
668 633
669 // Subscriber that listens to frame presentation events. 634 // Subscriber that listens to frame presentation events.
670 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; 635 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
671 636
672 base::WeakPtrFactory<RenderWidgetHostViewMac> 637 base::WeakPtrFactory<RenderWidgetHostViewMac>
673 software_frame_weak_ptr_factory_; 638 software_frame_weak_ptr_factory_;
674 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 639 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
675 }; 640 };
676 641
677 } // namespace content 642 } // namespace content
678 643
679 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 644 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698