Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 12220095: cc: Fix resource provider fences and add DCHECKs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bot Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/gl_renderer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/gpu/compositor_output_surface.h" 5 #include "content/renderer/gpu/compositor_output_surface.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "cc/compositor_frame.h" 8 #include "cc/compositor_frame.h"
9 #include "cc/output_surface_client.h" 9 #include "cc/output_surface_client.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 setpriority(PRIO_PROCESS, id, nice_value); 142 setpriority(PRIO_PROCESS, id, nice_value);
143 } 143 }
144 #else 144 #else
145 void SetThreadsPriorityToIdle(base::PlatformThreadId id) {} 145 void SetThreadsPriorityToIdle(base::PlatformThreadId id) {}
146 void SetThreadsPriorityToDefault(base::PlatformThreadId id) {} 146 void SetThreadsPriorityToDefault(base::PlatformThreadId id) {}
147 #endif 147 #endif
148 } 148 }
149 149
150 void CompositorOutputSurface::UpdateSmoothnessTakesPriority( 150 void CompositorOutputSurface::UpdateSmoothnessTakesPriority(
151 bool prefers_smoothness) { 151 bool prefers_smoothness) {
152 #if ENABLE_DCHECK 152 #ifndef NDEBUG
153 // If we use different compositor threads, we need to 153 // If we use different compositor threads, we need to
154 // use an atomic int to track prefer smoothness count. 154 // use an atomic int to track prefer smoothness count.
155 static int g_last_thread = base::PlatformThread::CurrentId(); 155 base::PlatformThreadId g_last_thread = base::PlatformThread::CurrentId();
joth 2013/04/05 05:30:32 removing the static here makes the dcheck below po
156 DCHECK_EQ(g_last_thread, base::PlatformThread::CurrentId()); 156 DCHECK_EQ(g_last_thread, base::PlatformThread::CurrentId());
157 #endif 157 #endif
158 if (prefers_smoothness_ == prefers_smoothness) 158 if (prefers_smoothness_ == prefers_smoothness)
159 return; 159 return;
160 // If this is the first surface to start preferring smoothness, 160 // If this is the first surface to start preferring smoothness,
161 // Throttle the main thread's priority. 161 // Throttle the main thread's priority.
162 if (prefers_smoothness_ == false && 162 if (prefers_smoothness_ == false &&
163 ++g_prefer_smoothness_count == 1) { 163 ++g_prefer_smoothness_count == 1) {
164 SetThreadsPriorityToIdle(main_thread_id_); 164 SetThreadsPriorityToIdle(main_thread_id_);
165 } 165 }
166 // If this is the last surface to stop preferring smoothness, 166 // If this is the last surface to stop preferring smoothness,
167 // Reset the main thread's priority to the default. 167 // Reset the main thread's priority to the default.
168 if (prefers_smoothness_ == true && 168 if (prefers_smoothness_ == true &&
169 --g_prefer_smoothness_count == 0) { 169 --g_prefer_smoothness_count == 0) {
170 SetThreadsPriorityToDefault(main_thread_id_); 170 SetThreadsPriorityToDefault(main_thread_id_);
171 } 171 }
172 prefers_smoothness_ = prefers_smoothness; 172 prefers_smoothness_ = prefers_smoothness;
173 } 173 }
174 174
175 } // namespace content 175 } // namespace content
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698