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/renderer_host/delegated_frame_host.h" | 5 #include "content/browser/renderer_host/delegated_frame_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 can_lock_compositor_ == NO_PENDING_COMMIT; | 113 can_lock_compositor_ == NO_PENDING_COMMIT; |
114 | 114 |
115 if (can_lock_compositor_ == YES_CAN_LOCK) | 115 if (can_lock_compositor_ == YES_CAN_LOCK) |
116 can_lock_compositor_ = YES_DID_LOCK; | 116 can_lock_compositor_ = YES_DID_LOCK; |
117 | 117 |
118 resize_lock_ = | 118 resize_lock_ = |
119 client_->DelegatedFrameHostCreateResizeLock(defer_compositor_lock); | 119 client_->DelegatedFrameHostCreateResizeLock(defer_compositor_lock); |
120 } | 120 } |
121 | 121 |
122 bool DelegatedFrameHost::ShouldCreateResizeLock() { | 122 bool DelegatedFrameHost::ShouldCreateResizeLock() { |
| 123 static const bool is_disabled = |
| 124 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 125 switches::kDisableResizeLock); |
| 126 if (is_disabled) |
| 127 return false; |
| 128 |
123 if (!client_->DelegatedFrameCanCreateResizeLock()) | 129 if (!client_->DelegatedFrameCanCreateResizeLock()) |
124 return false; | 130 return false; |
125 | 131 |
126 if (resize_lock_) | 132 if (resize_lock_) |
127 return false; | 133 return false; |
128 | 134 |
129 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); | 135 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); |
130 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) | 136 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) |
131 return false; | 137 return false; |
132 | 138 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 899 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
894 new_layer->SetShowSurface( | 900 new_layer->SetShowSurface( |
895 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 901 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
896 base::Bind(&RequireCallback, base::Unretained(manager)), | 902 base::Bind(&RequireCallback, base::Unretained(manager)), |
897 current_surface_size_, current_scale_factor_, | 903 current_surface_size_, current_scale_factor_, |
898 current_frame_size_in_dip_); | 904 current_frame_size_in_dip_); |
899 } | 905 } |
900 } | 906 } |
901 | 907 |
902 } // namespace content | 908 } // namespace content |
OLD | NEW |