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

Side by Side Diff: Source/web/PageWidgetDelegate.cpp

Issue 202533003: Don't schedule an animation during compositing dirty-bit setting unless needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add null check. Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.cpp ('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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 { 61 {
62 RefPtr<FrameView> view = mainFrameView(page); 62 RefPtr<FrameView> view = mainFrameView(page);
63 if (!view) 63 if (!view)
64 return; 64 return;
65 page->autoscrollController().animate(monotonicFrameBeginTime); 65 page->autoscrollController().animate(monotonicFrameBeginTime);
66 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime); 66 page->animator().serviceScriptedAnimations(monotonicFrameBeginTime);
67 } 67 }
68 68
69 void PageWidgetDelegate::layout(Page* page) 69 void PageWidgetDelegate::layout(Page* page)
70 { 70 {
71 RefPtr<FrameView> view = mainFrameView(page); 71 if (!page || !page->mainFrame())
72 if (!view)
73 return; 72 return;
74 // In order for our child HWNDs (NativeWindowWidgets) to update properly, 73 page->animator().updateLayoutAndStyleForPainting();
75 // they need to be told that we are updating the screen. The problem is that
76 // the native widgets need to recalculate their clip region and not overlap
77 // any of our non-native widgets. To force the resizing, call
78 // setFrameRect(). This will be a quick operation for most frames, but the
79 // NativeWindowWidgets will update a proper clipping region.
80 view->setFrameRect(view->frameRect());
81
82 // setFrameRect may have the side-effect of causing existing page layout to
83 // be invalidated, so layout needs to be called last.
84 view->updateLayoutAndStyleForPainting();
85 } 74 }
86 75
87 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) 76 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background)
88 { 77 {
89 if (rect.isEmpty()) 78 if (rect.isEmpty())
90 return; 79 return;
91 GraphicsContext gc(canvas); 80 GraphicsContext gc(canvas);
92 gc.setCertainlyOpaque(background == Opaque); 81 gc.setCertainlyOpaque(background == Opaque);
93 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); 82 gc.applyDeviceScaleFactor(page->deviceScaleFactor());
94 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); 83 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 { 202 {
214 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); 203 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event));
215 } 204 }
216 205
217 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event) 206 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo uchEvent& event)
218 { 207 {
219 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); 208 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event));
220 } 209 }
221 210
222 } 211 }
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698