OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor/delegated_frame_host.h" | 5 #include "content/browser/compositor/delegated_frame_host.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // the completion of latency infos (such as when taking a Snapshot.) | 216 // the completion of latency infos (such as when taking a Snapshot.) |
217 if (can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || | 217 if (can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || |
218 can_lock_compositor_ == NO_PENDING_COMMIT || | 218 can_lock_compositor_ == NO_PENDING_COMMIT || |
219 !resize_lock_.get()) | 219 !resize_lock_.get()) |
220 return false; | 220 return false; |
221 | 221 |
222 return size_in_dip != resize_lock_->expected_size(); | 222 return size_in_dip != resize_lock_->expected_size(); |
223 } | 223 } |
224 | 224 |
225 void DelegatedFrameHost::WasResized() { | 225 void DelegatedFrameHost::WasResized() { |
| 226 if (client_->DesiredFrameSize() != current_frame_size_in_dip_ && |
| 227 client_->GetHost()->is_hidden()) |
| 228 EvictDelegatedFrame(); |
226 MaybeCreateResizeLock(); | 229 MaybeCreateResizeLock(); |
227 } | 230 } |
228 | 231 |
229 gfx::Size DelegatedFrameHost::GetRequestedRendererSize() const { | 232 gfx::Size DelegatedFrameHost::GetRequestedRendererSize() const { |
230 if (resize_lock_) | 233 if (resize_lock_) |
231 return resize_lock_->expected_size(); | 234 return resize_lock_->expected_size(); |
232 else | 235 else |
233 return client_->DesiredFrameSize(); | 236 return client_->DesiredFrameSize(); |
234 } | 237 } |
235 | 238 |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 if (frame_provider_.get()) { | 908 if (frame_provider_.get()) { |
906 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 909 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
907 current_frame_size_in_dip_); | 910 current_frame_size_in_dip_); |
908 } | 911 } |
909 if (!surface_id_.is_null()) { | 912 if (!surface_id_.is_null()) { |
910 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 913 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
911 } | 914 } |
912 } | 915 } |
913 | 916 |
914 } // namespace content | 917 } // namespace content |
OLD | NEW |