| 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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 composition_range_ = range; | 863 composition_range_ = range; |
| 864 composition_bounds_ = character_bounds; | 864 composition_bounds_ = character_bounds; |
| 865 } | 865 } |
| 866 | 866 |
| 867 void RenderWidgetHostViewMac::DidUpdateBackingStore( | 867 void RenderWidgetHostViewMac::DidUpdateBackingStore( |
| 868 const gfx::Rect& scroll_rect, | 868 const gfx::Rect& scroll_rect, |
| 869 const gfx::Vector2d& scroll_delta, | 869 const gfx::Vector2d& scroll_delta, |
| 870 const std::vector<gfx::Rect>& copy_rects, | 870 const std::vector<gfx::Rect>& copy_rects, |
| 871 const ui::LatencyInfo& latency_info) { | 871 const ui::LatencyInfo& latency_info) { |
| 872 GotSoftwareFrame(); | 872 GotSoftwareFrame(); |
| 873 DidReceiveRendererFrame(); |
| 873 | 874 |
| 874 software_latency_info_.MergeWith(latency_info); | 875 software_latency_info_.MergeWith(latency_info); |
| 875 | 876 |
| 876 if (!is_hidden_) { | 877 if (!is_hidden_) { |
| 877 std::vector<gfx::Rect> rects(copy_rects); | 878 std::vector<gfx::Rect> rects(copy_rects); |
| 878 | 879 |
| 879 // Because the findbar might be open, we cannot use scrollRect:by: here. For | 880 // Because the findbar might be open, we cannot use scrollRect:by: here. For |
| 880 // now, simply mark all of scroll rect as dirty. | 881 // now, simply mark all of scroll rect as dirty. |
| 881 if (!scroll_rect.IsEmpty()) | 882 if (!scroll_rect.IsEmpty()) |
| 882 rects.push_back(scroll_rect); | 883 rects.push_back(scroll_rect); |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 return true; | 1506 return true; |
| 1506 } | 1507 } |
| 1507 | 1508 |
| 1508 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( | 1509 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
| 1509 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 1510 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| 1510 int gpu_host_id) { | 1511 int gpu_host_id) { |
| 1511 TRACE_EVENT0("browser", | 1512 TRACE_EVENT0("browser", |
| 1512 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 1513 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
| 1513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1514 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1514 | 1515 |
| 1516 DidReceiveRendererFrame(); |
| 1515 pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id, | 1517 pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id, |
| 1516 gpu_host_id)); | 1518 gpu_host_id)); |
| 1517 | 1519 |
| 1518 if (CompositorSwapBuffers(params.surface_handle, | 1520 if (CompositorSwapBuffers(params.surface_handle, |
| 1519 params.size, | 1521 params.size, |
| 1520 params.scale_factor, | 1522 params.scale_factor, |
| 1521 params.latency_info)) { | 1523 params.latency_info)) { |
| 1522 ThrottledAckPendingSwapBuffers(); | 1524 ThrottledAckPendingSwapBuffers(); |
| 1523 } else { | 1525 } else { |
| 1524 GotAcceleratedCompositingError(); | 1526 GotAcceleratedCompositingError(); |
| 1525 } | 1527 } |
| 1526 } | 1528 } |
| 1527 | 1529 |
| 1528 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( | 1530 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( |
| 1529 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 1531 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| 1530 int gpu_host_id) { | 1532 int gpu_host_id) { |
| 1531 TRACE_EVENT0("browser", | 1533 TRACE_EVENT0("browser", |
| 1532 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); | 1534 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); |
| 1533 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1535 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1534 | 1536 |
| 1537 DidReceiveRendererFrame(); |
| 1535 pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id, | 1538 pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id, |
| 1536 gpu_host_id)); | 1539 gpu_host_id)); |
| 1537 | 1540 |
| 1538 if (CompositorSwapBuffers(params.surface_handle, | 1541 if (CompositorSwapBuffers(params.surface_handle, |
| 1539 params.surface_size, | 1542 params.surface_size, |
| 1540 params.surface_scale_factor, | 1543 params.surface_scale_factor, |
| 1541 params.latency_info)) { | 1544 params.latency_info)) { |
| 1542 ThrottledAckPendingSwapBuffers(); | 1545 ThrottledAckPendingSwapBuffers(); |
| 1543 } else { | 1546 } else { |
| 1544 GotAcceleratedCompositingError(); | 1547 GotAcceleratedCompositingError(); |
| (...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3715 return YES; | 3718 return YES; |
| 3716 } | 3719 } |
| 3717 | 3720 |
| 3718 - (BOOL)isOpaque { | 3721 - (BOOL)isOpaque { |
| 3719 if (renderWidgetHostView_->use_core_animation_) | 3722 if (renderWidgetHostView_->use_core_animation_) |
| 3720 return YES; | 3723 return YES; |
| 3721 return [super isOpaque]; | 3724 return [super isOpaque]; |
| 3722 } | 3725 } |
| 3723 | 3726 |
| 3724 @end | 3727 @end |
| OLD | NEW |