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

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

Issue 13042012: Browser side changes for software compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 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 | Annotate | Revision Log
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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.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"
11 #include "cc/output/output_surface_client.h" 11 #include "cc/output/output_surface_client.h"
12 #include "content/common/view_messages.h" 12 #include "content/common/view_messages.h"
13 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
14 #include "content/renderer/render_thread_impl.h" 14 #include "content/renderer/render_thread_impl.h"
15 #include "ipc/ipc_forwarding_message_filter.h" 15 #include "ipc/ipc_forwarding_message_filter.h"
16 #include "ipc/ipc_sync_channel.h" 16 #include "ipc/ipc_sync_channel.h"
17 #include "ipc/ipc_sync_message_filter.h" 17 #include "ipc/ipc_sync_message_filter.h"
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
19 19
20 #if defined(OS_ANDROID) 20 #if defined(OS_ANDROID)
21 // TODO(epenner): Move thread priorities to base. (crbug.com/170549) 21 // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
22 #include <sys/resource.h> 22 #include <sys/resource.h>
23 #endif 23 #endif
24 24
25 using cc::CompositorFrame;
26 using cc::SoftwareOutputDevice;
27 using WebKit::WebGraphicsContext3D; 25 using WebKit::WebGraphicsContext3D;
28 26
29 namespace { 27 namespace {
30 // There are several compositor surfaces in a process, but they share the same 28 // There are several compositor surfaces in a process, but they share the same
31 // compositor thread, so we use a simple int here to track prefer-smoothness. 29 // compositor thread, so we use a simple int here to track prefer-smoothness.
32 int g_prefer_smoothness_count = 0; 30 int g_prefer_smoothness_count = 0;
33 } // namespace 31 } // namespace
34 32
35 namespace content { 33 namespace content {
36 34
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // If this is the last surface to stop preferring smoothness, 159 // If this is the last surface to stop preferring smoothness,
162 // Reset the main thread's priority to the default. 160 // Reset the main thread's priority to the default.
163 if (prefers_smoothness_ == true && 161 if (prefers_smoothness_ == true &&
164 --g_prefer_smoothness_count == 0) { 162 --g_prefer_smoothness_count == 0) {
165 SetThreadsPriorityToDefault(main_thread_id_); 163 SetThreadsPriorityToDefault(main_thread_id_);
166 } 164 }
167 prefers_smoothness_ = prefers_smoothness; 165 prefers_smoothness_ = prefers_smoothness;
168 } 166 }
169 167
170 } // namespace content 168 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698