| 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 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
| 8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 | 2208 |
| 2209 void RenderWidgetHostViewMac::PauseForPendingResizeOrRepaintsAndDraw() { | 2209 void RenderWidgetHostViewMac::PauseForPendingResizeOrRepaintsAndDraw() { |
| 2210 if (!render_widget_host_ || render_widget_host_->is_hidden()) | 2210 if (!render_widget_host_ || render_widget_host_->is_hidden()) |
| 2211 return; | 2211 return; |
| 2212 | 2212 |
| 2213 // Pausing for the overlay view prevents the underlay from receiving | 2213 // Pausing for the overlay view prevents the underlay from receiving |
| 2214 // frames. This may lead to large delays, causing overlaps. If both | 2214 // frames. This may lead to large delays, causing overlaps. If both |
| 2215 // overlay and underlay resize at the same time, let them both to have | 2215 // overlay and underlay resize at the same time, let them both to have |
| 2216 // some time waiting. See crbug.com/352020. | 2216 // some time waiting. See crbug.com/352020. |
| 2217 if (underlay_view_ && | 2217 if (underlay_view_ && |
| 2218 underlay_view_->render_widget_host_ && |
| 2218 !underlay_view_->render_widget_host_-> | 2219 !underlay_view_->render_widget_host_-> |
| 2219 CanPauseForPendingResizeOrRepaints()) | 2220 CanPauseForPendingResizeOrRepaints()) |
| 2220 return; | 2221 return; |
| 2221 | 2222 |
| 2222 // Ensure that all frames are acked before waiting for a frame to come in. | 2223 // Ensure that all frames are acked before waiting for a frame to come in. |
| 2223 // Note that we will draw a frame at the end of this function, so it is safe | 2224 // Note that we will draw a frame at the end of this function, so it is safe |
| 2224 // to ack a never-drawn frame here. | 2225 // to ack a never-drawn frame here. |
| 2225 SendPendingSwapAck(); | 2226 SendPendingSwapAck(); |
| 2226 | 2227 |
| 2227 // Wait for a frame of the right size to come in. | 2228 // Wait for a frame of the right size to come in. |
| (...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4310 } | 4311 } |
| 4311 | 4312 |
| 4312 - (void)disableRendering { | 4313 - (void)disableRendering { |
| 4313 // Disable the fade-out animation as the layer is removed. | 4314 // Disable the fade-out animation as the layer is removed. |
| 4314 ScopedCAActionDisabler disabler; | 4315 ScopedCAActionDisabler disabler; |
| 4315 [self removeFromSuperlayer]; | 4316 [self removeFromSuperlayer]; |
| 4316 renderWidgetHostView_ = nil; | 4317 renderWidgetHostView_ = nil; |
| 4317 } | 4318 } |
| 4318 | 4319 |
| 4319 @end // implementation SoftwareLayer | 4320 @end // implementation SoftwareLayer |
| OLD | NEW |