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

Side by Side Diff: sky/engine/core/frame/FrameView.h

Issue 850763007: Delete canInvalidatePaintDuringPerformLayout. (Closed) Base URL: git@github.com:domokit/mojo.git@PaintInvalidationState
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | sky/engine/core/frame/FrameView.cpp » ('j') | 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) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; 75 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const;
76 76
77 void layout(bool allowSubtree = true); 77 void layout(bool allowSubtree = true);
78 bool didFirstLayout() const; 78 bool didFirstLayout() const;
79 void scheduleRelayout(); 79 void scheduleRelayout();
80 void scheduleRelayoutOfSubtree(RenderObject*); 80 void scheduleRelayoutOfSubtree(RenderObject*);
81 bool layoutPending() const; 81 bool layoutPending() const;
82 bool isInPerformLayout() const; 82 bool isInPerformLayout() const;
83 83
84 void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaint DuringPerformLayout = b; }
85 bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidateP aintDuringPerformLayout; }
86
87 RenderObject* layoutRoot(bool onlyDuringLayout = false) const; 84 RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
88 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; } 85 void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
89 int layoutCount() const { return m_layoutCount; } 86 int layoutCount() const { return m_layoutCount; }
90 87
91 bool needsLayout() const; 88 bool needsLayout() const;
92 void setNeedsLayout(); 89 void setNeedsLayout();
93 90
94 // Methods for getting/setting the size Blink should use to layout the conte nts. 91 // Methods for getting/setting the size Blink should use to layout the conte nts.
95 // FIXME(sky): Remove the scrollbars argument now that FrameView doesn't scr oll. 92 // FIXME(sky): Remove the scrollbars argument now that FrameView doesn't scr oll.
96 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; 93 IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 DocumentLifecycle& lifecycle() const; 217 DocumentLifecycle& lifecycle() const;
221 218
222 // FIXME(sky): Remove now that we're not a ScrollView? 219 // FIXME(sky): Remove now that we're not a ScrollView?
223 void contentsResized(); 220 void contentsResized();
224 221
225 bool wasViewportResized(); 222 bool wasViewportResized();
226 void sendResizeEventIfNeeded(); 223 void sendResizeEventIfNeeded();
227 224
228 void setLayoutSizeInternal(const IntSize&); 225 void setLayoutSizeInternal(const IntSize&);
229 226
230 bool paintInvalidationIsAllowed() const
231 {
232 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
233 }
234
235 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache 227 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache
236 static bool s_inPaintContents; 228 static bool s_inPaintContents;
237 229
238 LayoutSize m_size; 230 LayoutSize m_size;
239 231
240 RefPtr<LocalFrame> m_frame; 232 RefPtr<LocalFrame> m_frame;
241 233
242 bool m_hasPendingLayout; 234 bool m_hasPendingLayout;
243 RenderObject* m_layoutSubtreeRoot; 235 RenderObject* m_layoutSubtreeRoot;
244 236
245 bool m_layoutSchedulingEnabled; 237 bool m_layoutSchedulingEnabled;
246 bool m_inPerformLayout; 238 bool m_inPerformLayout;
247 bool m_canInvalidatePaintDuringPerformLayout;
248 bool m_inSynchronousPostLayout; 239 bool m_inSynchronousPostLayout;
249 int m_layoutCount; 240 int m_layoutCount;
250 unsigned m_nestedLayoutCount; 241 unsigned m_nestedLayoutCount;
251 Timer<FrameView> m_postLayoutTasksTimer; 242 Timer<FrameView> m_postLayoutTasksTimer;
252 bool m_firstLayoutCallbackPending; 243 bool m_firstLayoutCallbackPending;
253 244
254 bool m_firstLayout; 245 bool m_firstLayout;
255 bool m_isTransparent; 246 bool m_isTransparent;
256 Color m_baseBackgroundColor; 247 Color m_baseBackgroundColor;
257 IntSize m_lastViewportSize; 248 IntSize m_lastViewportSize;
(...skipping 19 matching lines...) Expand all
277 float m_inputEventsScaleFactorForEmulation; 268 float m_inputEventsScaleFactorForEmulation;
278 269
279 IntSize m_layoutSize; 270 IntSize m_layoutSize;
280 bool m_layoutSizeFixedToFrameSize; 271 bool m_layoutSizeFixedToFrameSize;
281 272
282 Vector<IntRect> m_tickmarks; 273 Vector<IntRect> m_tickmarks;
283 }; 274 };
284 275
285 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 276 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
286 277
287 class AllowPaintInvalidationScope {
288 public:
289 explicit AllowPaintInvalidationScope(FrameView* view)
290 : m_view(view)
291 , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false)
292 {
293 if (!m_view)
294 return;
295
296 m_view->setCanInvalidatePaintDuringPerformLayout(true);
297 }
298
299 ~AllowPaintInvalidationScope()
300 {
301 if (!m_view)
302 return;
303
304 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
305 }
306 private:
307 FrameView* m_view;
308 bool m_originalValue;
309 };
310
311 } // namespace blink 278 } // namespace blink
312 279
313 #endif // SKY_ENGINE_CORE_FRAME_FRAMEVIEW_H_ 280 #endif // SKY_ENGINE_CORE_FRAME_FRAMEVIEW_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698