- Reduce CPU usage with requestAnimationFrame by maintaining a consistent 60fps frame rate (issue #456).

- (Win) Reduce memory/CPU usage with UpdateInputMethod by restricting tasks to every 100ms (issue #454).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@423 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-12-16 12:24:09 +00:00
parent 10b3b3cc41
commit 87507e875c
5 changed files with 98 additions and 44 deletions

View File

@@ -302,7 +302,7 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
DidInvalidateRect(clip_rect);
}
void WebWidgetHost::ScheduleComposite() {
void WebWidgetHost::Invalidate() {
int width = logical_size_.width();
int height = logical_size_.height();
GdkRectangle grect = {
@@ -323,6 +323,7 @@ WebWidgetHost::WebWidgetHost()
canvas_h_(0),
popup_(false),
has_update_task_(false),
has_invalidate_task_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
set_painting(false);
}
@@ -414,6 +415,11 @@ void WebWidgetHost::Paint() {
cairo_destroy(cairo_drawable);
gdk_window_end_paint(window);
// Used with scheduled invalidation to maintain a consistent frame rate.
paint_last_call_ = base::TimeTicks::Now();
if (has_invalidate_task_)
has_invalidate_task_ = false;
}
void WebWidgetHost::SetTooltipText(const CefString& tooltip_text)