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 <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 gfx::Range ConvertCharacterRangeToCompositionRange( | 391 gfx::Range ConvertCharacterRangeToCompositionRange( |
392 const gfx::Range& request_range); | 392 const gfx::Range& request_range); |
393 | 393 |
394 // These member variables should be private, but the associated ObjC class | 394 // These member variables should be private, but the associated ObjC class |
395 // needs access to them and can't be made a friend. | 395 // needs access to them and can't be made a friend. |
396 | 396 |
397 // The associated Model. Can be NULL if Destroy() is called when | 397 // The associated Model. Can be NULL if Destroy() is called when |
398 // someone (other than superview) has retained |cocoa_view_|. | 398 // someone (other than superview) has retained |cocoa_view_|. |
399 RenderWidgetHostImpl* render_widget_host_; | 399 RenderWidgetHostImpl* render_widget_host_; |
400 | 400 |
401 // This is true when we are currently painting. In the legacy renderer, this | 401 // This is true when we are currently painting and thus should handle extra |
402 // means we should handle extra paint requests by expanding the invalid rect | 402 // paint requests by expanding the invalid rect rather than actually painting. |
403 // rather than actually painting. In hardware compositing it means that we | |
404 // are inside a draw callback and should not wait for frames to draw before | |
405 // acknowledging them. | |
406 bool about_to_validate_and_paint_; | 403 bool about_to_validate_and_paint_; |
407 | 404 |
408 // This is true when we have already scheduled a call to | 405 // This is true when we have already scheduled a call to |
409 // |-callSetNeedsDisplayInRect:| but it has not been fulfilled yet. Used to | 406 // |-callSetNeedsDisplayInRect:| but it has not been fulfilled yet. Used to |
410 // prevent us from scheduling multiple calls. | 407 // prevent us from scheduling multiple calls. |
411 bool call_set_needs_display_in_rect_pending_; | 408 bool call_set_needs_display_in_rect_pending_; |
412 | 409 |
413 // Whether last rendered frame was accelerated. | 410 // Whether last rendered frame was accelerated. |
414 bool last_frame_was_accelerated_; | 411 bool last_frame_was_accelerated_; |
415 | 412 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 484 |
488 // The scale factor of the backing store and all CALayers. Note that this is | 485 // The scale factor of the backing store and all CALayers. Note that this is |
489 // updated based on ViewScaleFactor with some delay. | 486 // updated based on ViewScaleFactor with some delay. |
490 float backing_store_scale_factor_; | 487 float backing_store_scale_factor_; |
491 | 488 |
492 void AddPendingLatencyInfo( | 489 void AddPendingLatencyInfo( |
493 const std::vector<ui::LatencyInfo>& latency_info); | 490 const std::vector<ui::LatencyInfo>& latency_info); |
494 void SendPendingLatencyInfoToHost(); | 491 void SendPendingLatencyInfoToHost(); |
495 void TickPendingLatencyInfoDelay(); | 492 void TickPendingLatencyInfoDelay(); |
496 | 493 |
497 void SendPendingSwapAck(); | |
498 | |
499 private: | 494 private: |
500 friend class RenderWidgetHostView; | 495 friend class RenderWidgetHostView; |
501 friend class RenderWidgetHostViewMacTest; | 496 friend class RenderWidgetHostViewMacTest; |
502 | 497 |
503 struct PendingSwapAck { | |
504 PendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id) | |
505 : route_id(route_id), | |
506 gpu_host_id(gpu_host_id), | |
507 renderer_id(renderer_id) {} | |
508 int32 route_id; | |
509 int gpu_host_id; | |
510 int32 renderer_id; | |
511 }; | |
512 scoped_ptr<PendingSwapAck> pending_swap_ack_; | |
513 void AddPendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id); | |
514 | |
515 // The view will associate itself with the given widget. The native view must | 498 // The view will associate itself with the given widget. The native view must |
516 // be hooked up immediately to the view hierarchy, or else when it is | 499 // be hooked up immediately to the view hierarchy, or else when it is |
517 // deleted it will delete this out from under the caller. | 500 // deleted it will delete this out from under the caller. |
518 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); | 501 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); |
519 | 502 |
520 // Returns whether this render view is a popup (autocomplete window). | 503 // Returns whether this render view is a popup (autocomplete window). |
521 bool IsPopup() const; | 504 bool IsPopup() const; |
522 | 505 |
523 // Shuts down the render_widget_host_. This is a separate function so we can | 506 // Shuts down the render_widget_host_. This is a separate function so we can |
524 // invoke it from the message loop. | 507 // invoke it from the message loop. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 594 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
612 | 595 |
613 base::WeakPtrFactory<RenderWidgetHostViewMac> | 596 base::WeakPtrFactory<RenderWidgetHostViewMac> |
614 software_frame_weak_ptr_factory_; | 597 software_frame_weak_ptr_factory_; |
615 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 598 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
616 }; | 599 }; |
617 | 600 |
618 } // namespace content | 601 } // namespace content |
619 | 602 |
620 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 603 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |