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 and thus should handle extra | 401 // This is true when we are currently painting. In the legacy renderer, this |
402 // paint requests by expanding the invalid rect rather than actually painting. | 402 // means we should handle extra paint requests by expanding the invalid rect |
| 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. |
403 bool about_to_validate_and_paint_; | 406 bool about_to_validate_and_paint_; |
404 | 407 |
405 // This is true when we have already scheduled a call to | 408 // This is true when we have already scheduled a call to |
406 // |-callSetNeedsDisplayInRect:| but it has not been fulfilled yet. Used to | 409 // |-callSetNeedsDisplayInRect:| but it has not been fulfilled yet. Used to |
407 // prevent us from scheduling multiple calls. | 410 // prevent us from scheduling multiple calls. |
408 bool call_set_needs_display_in_rect_pending_; | 411 bool call_set_needs_display_in_rect_pending_; |
409 | 412 |
410 // Whether last rendered frame was accelerated. | 413 // Whether last rendered frame was accelerated. |
411 bool last_frame_was_accelerated_; | 414 bool last_frame_was_accelerated_; |
412 | 415 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 479 |
477 int window_number() const; | 480 int window_number() const; |
478 | 481 |
479 float scale_factor() const; | 482 float scale_factor() const; |
480 | 483 |
481 void AddPendingLatencyInfo( | 484 void AddPendingLatencyInfo( |
482 const std::vector<ui::LatencyInfo>& latency_info); | 485 const std::vector<ui::LatencyInfo>& latency_info); |
483 void SendPendingLatencyInfoToHost(); | 486 void SendPendingLatencyInfoToHost(); |
484 void TickPendingLatencyInfoDelay(); | 487 void TickPendingLatencyInfoDelay(); |
485 | 488 |
| 489 void SendPendingSwapAck(); |
| 490 |
486 private: | 491 private: |
487 friend class RenderWidgetHostView; | 492 friend class RenderWidgetHostView; |
488 friend class RenderWidgetHostViewMacTest; | 493 friend class RenderWidgetHostViewMacTest; |
489 | 494 |
| 495 struct PendingSwapAck { |
| 496 PendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id) |
| 497 : route_id(route_id), |
| 498 gpu_host_id(gpu_host_id), |
| 499 renderer_id(renderer_id) {} |
| 500 int32 route_id; |
| 501 int gpu_host_id; |
| 502 int32 renderer_id; |
| 503 }; |
| 504 scoped_ptr<PendingSwapAck> pending_swap_ack_; |
| 505 void AddPendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id); |
| 506 |
490 // The view will associate itself with the given widget. The native view must | 507 // The view will associate itself with the given widget. The native view must |
491 // be hooked up immediately to the view hierarchy, or else when it is | 508 // be hooked up immediately to the view hierarchy, or else when it is |
492 // deleted it will delete this out from under the caller. | 509 // deleted it will delete this out from under the caller. |
493 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); | 510 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); |
494 | 511 |
495 // Returns whether this render view is a popup (autocomplete window). | 512 // Returns whether this render view is a popup (autocomplete window). |
496 bool IsPopup() const; | 513 bool IsPopup() const; |
497 | 514 |
498 // Shuts down the render_widget_host_. This is a separate function so we can | 515 // Shuts down the render_widget_host_. This is a separate function so we can |
499 // invoke it from the message loop. | 516 // invoke it from the message loop. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 603 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
587 | 604 |
588 base::WeakPtrFactory<RenderWidgetHostViewMac> | 605 base::WeakPtrFactory<RenderWidgetHostViewMac> |
589 software_frame_weak_ptr_factory_; | 606 software_frame_weak_ptr_factory_; |
590 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 607 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
591 }; | 608 }; |
592 | 609 |
593 } // namespace content | 610 } // namespace content |
594 | 611 |
595 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 612 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |