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

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

Issue 188873005: Do not dynamically call setLayer on RenderWidgetHostViewCocoa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up Created 6 years, 9 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // value returns true for is_null() if we are not recording whiteout times. 434 // value returns true for is_null() if we are not recording whiteout times.
435 base::TimeTicks whiteout_start_time_; 435 base::TimeTicks whiteout_start_time_;
436 436
437 // The time it took after this view was selected for it to be fully painted. 437 // The time it took after this view was selected for it to be fully painted.
438 base::TimeTicks web_contents_switch_paint_time_; 438 base::TimeTicks web_contents_switch_paint_time_;
439 439
440 // Current text input type. 440 // Current text input type.
441 ui::TextInputType text_input_type_; 441 ui::TextInputType text_input_type_;
442 bool can_compose_inline_; 442 bool can_compose_inline_;
443 443
444 // The background CoreAnimation layer used before compositing nor software 444 // The background CoreAnimation layer which is hosted by |cocoa_view_|.
445 // compositing has been enabled, and when the compositing or software 445 // The compositing or software layers will be added as sublayers to this.
446 // compositing surface has been evicted.
447 base::scoped_nsobject<CALayer> background_layer_; 446 base::scoped_nsobject<CALayer> background_layer_;
448 447
449 // The CoreAnimation layer for software compositing. Note that at most one of 448 // The CoreAnimation layer for software compositing. This should be NULL
450 // |software_layer_| and |compositing_iosurface_layer_| may be non-NULL. 449 // when software compositing is not in use.
451 base::scoped_nsobject<SoftwareLayer> software_layer_; 450 base::scoped_nsobject<SoftwareLayer> software_layer_;
452 451
453 // Accelerated compositing structures. These may be dynamically created and 452 // Accelerated compositing structures. These may be dynamically created and
454 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. 453 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer.
455 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; 454 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_;
456 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; 455 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_;
457 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; 456 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_;
458 457
459 // Timer used to dynamically transition the compositing layer in and out of 458 // Timer used to dynamically transition the compositing layer in and out of
460 // asynchronous mode. 459 // asynchronous mode.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // deleted it will delete this out from under the caller. 537 // deleted it will delete this out from under the caller.
539 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); 538 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget);
540 539
541 // Returns whether this render view is a popup (autocomplete window). 540 // Returns whether this render view is a popup (autocomplete window).
542 bool IsPopup() const; 541 bool IsPopup() const;
543 542
544 // Shuts down the render_widget_host_. This is a separate function so we can 543 // Shuts down the render_widget_host_. This is a separate function so we can
545 // invoke it from the message loop. 544 // invoke it from the message loop.
546 void ShutdownHost(); 545 void ShutdownHost();
547 546
548 void CreateSoftwareLayerAndDestroyCompositedLayer(); 547 void CreateSoftwareLayer();
549 void DestroySoftwareLayer(); 548 void DestroySoftwareLayer();
550 549
551 bool CreateCompositedIOSurface(); 550 bool CreateCompositedIOSurface();
552 bool CreateCompositedLayerAndDestroySoftwareLayer(); 551 bool CreateCompositedIOSurfaceLayer();
553 enum DestroyContextBehavior { 552 enum DestroyContextBehavior {
554 kLeaveContextBoundToView, 553 kLeaveContextBoundToView,
555 kDestroyContext, 554 kDestroyContext,
556 }; 555 };
556 void DestroyCompositedIOSurfaceLayer();
557 void DestroyCompositedIOSurfaceAndLayer(DestroyContextBehavior 557 void DestroyCompositedIOSurfaceAndLayer(DestroyContextBehavior
558 destroy_context_behavior); 558 destroy_context_behavior);
559 559
560 // Unbind the GL context (if any) that is bound to |cocoa_view_|. 560 // Unbind the GL context (if any) that is bound to |cocoa_view_|.
561 void ClearBoundContextDrawable(); 561 void ClearBoundContextDrawable();
562 562
563 // Called when a GPU SwapBuffers is received. 563 // Called when a GPU SwapBuffers is received.
564 void GotAcceleratedFrame(); 564 void GotAcceleratedFrame();
565 565
566 // Called when a software DIB is received. 566 // Called when a software DIB is received.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; 641 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
642 642
643 base::WeakPtrFactory<RenderWidgetHostViewMac> 643 base::WeakPtrFactory<RenderWidgetHostViewMac>
644 software_frame_weak_ptr_factory_; 644 software_frame_weak_ptr_factory_;
645 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 645 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
646 }; 646 };
647 647
648 } // namespace content 648 } // namespace content
649 649
650 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 650 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698