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_enabled = | |
124 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
125 switches::kEnableResizeLock) || | |
126 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
127 switches::kEnableResizeLock) == "true"; | |
piman
2016/07/08 18:42:44
Do you want instead do a --disable-resize-lock?
O
sky
2016/07/08 19:16:53
I was trying to avoid the negative, but you're rig
| |
128 if (!is_enabled) | |
129 return false; | |
130 | |
123 if (!client_->DelegatedFrameCanCreateResizeLock()) | 131 if (!client_->DelegatedFrameCanCreateResizeLock()) |
124 return false; | 132 return false; |
125 | 133 |
126 if (resize_lock_) | 134 if (resize_lock_) |
127 return false; | 135 return false; |
128 | 136 |
129 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); | 137 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); |
130 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) | 138 if (desired_size == current_frame_size_in_dip_ || desired_size.IsEmpty()) |
131 return false; | 139 return false; |
132 | 140 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
893 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 901 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
894 new_layer->SetShowSurface( | 902 new_layer->SetShowSurface( |
895 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 903 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
896 base::Bind(&RequireCallback, base::Unretained(manager)), | 904 base::Bind(&RequireCallback, base::Unretained(manager)), |
897 current_surface_size_, current_scale_factor_, | 905 current_surface_size_, current_scale_factor_, |
898 current_frame_size_in_dip_); | 906 current_frame_size_in_dip_); |
899 } | 907 } |
900 } | 908 } |
901 | 909 |
902 } // namespace content | 910 } // namespace content |
OLD | NEW |