mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- 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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user