summaryrefslogtreecommitdiffstats
path: root/content/renderer/gpu/compositor_output_surface.h
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 03:22:15 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 03:22:15 +0000
commit34351ccaf33b4201990387a3c7e1e8719b4c8fbf (patch)
tree17e343500a2c5c64796d2cf94840ba2c9ff25963 /content/renderer/gpu/compositor_output_surface.h
parenteba04f08da9daae5f2cd4e6dee6f5547c9c60b43 (diff)
downloadchromium_src-34351ccaf33b4201990387a3c7e1e8719b4c8fbf.zip
chromium_src-34351ccaf33b4201990387a3c7e1e8719b4c8fbf.tar.gz
chromium_src-34351ccaf33b4201990387a3c7e1e8719b4c8fbf.tar.bz2
cc: Reduce renderer_main thread priority when prefer_smoothness is set
This tracks how many compositors prefer smooth frame-rate, and throttles/resets the main thread's priority as appropriate. Compositors in the same process share the same thread, so we track this count in a static int. All thread priorities use #ifdefs for reduced risk and easier merging. This needs to be abstracted and enabled on other platforms (http://crbug.com/170549) BUG=164651 Review URL: https://chromiumcodereview.appspot.com/12026004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/gpu/compositor_output_surface.h')
-rw-r--r--content/renderer/gpu/compositor_output_surface.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/renderer/gpu/compositor_output_surface.h b/content/renderer/gpu/compositor_output_surface.h
index 57b344a..ffc6965 100644
--- a/content/renderer/gpu/compositor_output_surface.h
+++ b/content/renderer/gpu/compositor_output_surface.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
+#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "cc/output_surface.h"
#include "cc/software_output_device.h"
@@ -46,6 +47,10 @@ class CompositorOutputSurface
virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE;
virtual void SendFrameToParentCompositor(cc::CompositorFrame*) OVERRIDE;
+ // TODO(epenner): This seems out of place here and would be a better fit
+ // int CompositorThread after it is fully refactored (http://crbug/170828)
+ virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) OVERRIDE;
+
private:
class CompositorOutputSurfaceProxy :
public base::RefCountedThreadSafe<CompositorOutputSurfaceProxy> {
@@ -79,6 +84,8 @@ class CompositorOutputSurface
struct Capabilities capabilities_;
scoped_ptr<WebKit::WebGraphicsContext3D> context3D_;
scoped_ptr<cc::SoftwareOutputDevice> software_device_;
+ bool prefers_smoothness_;
+ base::PlatformThreadId main_thread_id_;
};
} // namespace content