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

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

Issue 16189012: Add a path to use CALayers to display content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve again Created 7 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 | Annotate | Revision Log
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 13 matching lines...) Expand all
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
25 #include "ui/base/cocoa/base_view.h" 25 #include "ui/base/cocoa/base_view.h"
26 #include "webkit/common/cursors/webcursor.h" 26 #include "webkit/common/cursors/webcursor.h"
27 27
28 namespace content { 28 namespace content {
29 class CompositingIOSurfaceMac; 29 class CompositingIOSurfaceMac;
30 class RenderWidgetHostViewMac; 30 class RenderWidgetHostViewMac;
31 class RenderWidgetHostViewMacEditCommandHelper; 31 class RenderWidgetHostViewMacEditCommandHelper;
32 } 32 }
33 33
34 @class CompositingIOSurfaceLayer;
34 @class FullscreenWindowManager; 35 @class FullscreenWindowManager;
35 @protocol RenderWidgetHostViewMacDelegate; 36 @protocol RenderWidgetHostViewMacDelegate;
36 @class ToolTip; 37 @class ToolTip;
37 38
38 @protocol RenderWidgetHostViewMacOwner 39 @protocol RenderWidgetHostViewMacOwner
39 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac; 40 - (content::RenderWidgetHostViewMac*)renderWidgetHostViewMac;
40 @end 41 @end
41 42
42 // This is the view that lives in the Cocoa view hierarchy. In Windows-land, 43 // This is the view that lives in the Cocoa view hierarchy. In Windows-land,
43 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles 44 // RenderWidgetHostViewWin is both the view and the delegate. We split the roles
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // value returns true for is_null() if we are not recording whiteout times. 387 // value returns true for is_null() if we are not recording whiteout times.
387 base::TimeTicks whiteout_start_time_; 388 base::TimeTicks whiteout_start_time_;
388 389
389 // The time it took after this view was selected for it to be fully painted. 390 // The time it took after this view was selected for it to be fully painted.
390 base::TimeTicks web_contents_switch_paint_time_; 391 base::TimeTicks web_contents_switch_paint_time_;
391 392
392 // Current text input type. 393 // Current text input type.
393 ui::TextInputType text_input_type_; 394 ui::TextInputType text_input_type_;
394 bool can_compose_inline_; 395 bool can_compose_inline_;
395 396
397 scoped_nsobject<CALayer> software_layer_;
398 scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_;
396 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; 399 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_;
397 400
398 // Whether to allow overlapping views. 401 // Whether to allow overlapping views.
399 bool allow_overlapping_views_; 402 bool allow_overlapping_views_;
400 403
404 // Whether to use the CoreAnimation path to draw content.
405 bool use_core_animation_;
406
401 NSWindow* pepper_fullscreen_window() const { 407 NSWindow* pepper_fullscreen_window() const {
402 return pepper_fullscreen_window_; 408 return pepper_fullscreen_window_;
403 } 409 }
404 410
405 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing(); 411 CONTENT_EXPORT void release_pepper_fullscreen_window_for_testing();
406 412
407 RenderWidgetHostViewMac* fullscreen_parent_host_view() const { 413 RenderWidgetHostViewMac* fullscreen_parent_host_view() const {
408 return fullscreen_parent_host_view_; 414 return fullscreen_parent_host_view_;
409 } 415 }
410 416
411 RenderWidgetHostViewFrameSubscriber* frame_subscriber() const { 417 RenderWidgetHostViewFrameSubscriber* frame_subscriber() const {
412 return frame_subscriber_.get(); 418 return frame_subscriber_.get();
413 } 419 }
414 420
415 int window_number() const; 421 int window_number() const;
416 422
423 float scale_factor() const;
424
425 bool is_hidden() const { return is_hidden_; }
426
417 private: 427 private:
418 friend class RenderWidgetHostView; 428 friend class RenderWidgetHostView;
419 friend class RenderWidgetHostViewMacTest; 429 friend class RenderWidgetHostViewMacTest;
420 430
421 // The view will associate itself with the given widget. The native view must 431 // The view will associate itself with the given widget. The native view must
422 // be hooked up immediately to the view hierarchy, or else when it is 432 // be hooked up immediately to the view hierarchy, or else when it is
423 // deleted it will delete this out from under the caller. 433 // deleted it will delete this out from under the caller.
424 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); 434 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget);
425 435
426 // Returns whether this render view is a popup (autocomplete window). 436 // Returns whether this render view is a popup (autocomplete window).
427 bool IsPopup() const; 437 bool IsPopup() const;
428 438
429 // Shuts down the render_widget_host_. This is a separate function so we can 439 // Shuts down the render_widget_host_. This is a separate function so we can
430 // invoke it from the message loop. 440 // invoke it from the message loop.
431 void ShutdownHost(); 441 void ShutdownHost();
432 442
443 // Change this view to use CoreAnimation to draw.
444 void EnableCoreAnimation();
445
433 // Called when a GPU SwapBuffers is received. 446 // Called when a GPU SwapBuffers is received.
434 void GotAcceleratedFrame(); 447 void GotAcceleratedFrame();
435 // Called when a software DIB is received. 448 // Called when a software DIB is received.
436 void GotSoftwareFrame(); 449 void GotSoftwareFrame();
437 450
438 void OnPluginFocusChanged(bool focused, int plugin_id); 451 void OnPluginFocusChanged(bool focused, int plugin_id);
439 void OnStartPluginIme(); 452 void OnStartPluginIme();
440 CONTENT_EXPORT void OnAcceleratedSurfaceSetIOSurface( 453 CONTENT_EXPORT void OnAcceleratedSurfaceSetIOSurface(
441 gfx::PluginWindowHandle window, 454 gfx::PluginWindowHandle window,
442 int32 width, 455 int32 width,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 507
495 // Subscriber that listens to frame presentation events. 508 // Subscriber that listens to frame presentation events.
496 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; 509 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
497 510
498 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 511 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
499 }; 512 };
500 513
501 } // namespace content 514 } // namespace content
502 515
503 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 516 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698