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

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

Issue 168193002: Fix compositing chicken and egg problem in updateControlTints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 /* 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 view->serviceScriptedAnimations(monotonicFrameBeginTime); 66 view->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 RefPtr<FrameView> view = mainFrameView(page);
abarth-chromium 2014/02/15 07:12:19 Notice the RefPtr here
72 if (!view) 72 if (!view)
73 return; 73 return;
74 // In order for our child HWNDs (NativeWindowWidgets) to update properly, 74 // In order for our child HWNDs (NativeWindowWidgets) to update properly,
75 // they need to be told that we are updating the screen. The problem is that 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 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 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 78 // setFrameRect(). This will be a quick operation for most frames, but the
79 // NativeWindowWidgets will update a proper clipping region. 79 // NativeWindowWidgets will update a proper clipping region.
80 view->setFrameRect(view->frameRect()); 80 view->setFrameRect(view->frameRect());
81 81
82 // setFrameRect may have the side-effect of causing existing page layout to 82 // setFrameRect may have the side-effect of causing existing page layout to
83 // be invalidated, so layout needs to be called last. 83 // be invalidated, so layout needs to be called last.
84 view->updateLayoutAndStyleIfNeededRecursive(); 84 view->updateLayoutAndStyleForPainting();
85
86 // For now, as we know this is the point in code where the compositor has
87 // actually asked for Blink to update the composited layer tree. So finally
88 // do all the deferred work for updateCompositingLayers() here.
89 if (RenderView* renderView = view->renderView())
90 renderView->compositor()->updateCompositingLayers();
91 } 85 }
92 86
93 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) 87 void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background)
94 { 88 {
95 if (rect.isEmpty()) 89 if (rect.isEmpty())
96 return; 90 return;
97 GraphicsContext gc(canvas); 91 GraphicsContext gc(canvas);
98 gc.setCertainlyOpaque(background == Opaque); 92 gc.setCertainlyOpaque(background == Opaque);
99 gc.applyDeviceScaleFactor(page->deviceScaleFactor()); 93 gc.applyDeviceScaleFactor(page->deviceScaleFactor());
100 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f); 94 gc.setUseHighResMarkers(page->deviceScaleFactor() > 1.5f);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 { 213 {
220 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event)); 214 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m ainFrame.view(), event));
221 } 215 }
222 216
223 bool PageWidgetEventHandler::handleTouchEvent(Frame& mainFrame, const WebTouchEv ent& event) 217 bool PageWidgetEventHandler::handleTouchEvent(Frame& mainFrame, const WebTouchEv ent& event)
224 { 218 {
225 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event)); 219 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m ainFrame.view(), event));
226 } 220 }
227 221
228 } 222 }
OLDNEW
« Source/core/frame/FrameView.cpp ('K') | « Source/core/page/FocusController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698