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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.h

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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
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 13 matching lines...) Expand all
24 24
25 #ifndef FrameView_h 25 #ifndef FrameView_h
26 #define FrameView_h 26 #define FrameView_h
27 27
28 #include "core/CoreExport.h" 28 #include "core/CoreExport.h"
29 #include "core/dom/DocumentLifecycle.h" 29 #include "core/dom/DocumentLifecycle.h"
30 #include "core/frame/FrameViewAutoSizeInfo.h" 30 #include "core/frame/FrameViewAutoSizeInfo.h"
31 #include "core/frame/LayoutSubtreeRootList.h" 31 #include "core/frame/LayoutSubtreeRootList.h"
32 #include "core/frame/RootFrameViewport.h" 32 #include "core/frame/RootFrameViewport.h"
33 #include "core/layout/LayoutAnalyzer.h" 33 #include "core/layout/LayoutAnalyzer.h"
34 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
34 #include "core/paint/PaintPhase.h" 35 #include "core/paint/PaintPhase.h"
35 #include "platform/RuntimeEnabledFeatures.h" 36 #include "platform/RuntimeEnabledFeatures.h"
36 #include "platform/Widget.h" 37 #include "platform/Widget.h"
37 #include "platform/geometry/IntRect.h" 38 #include "platform/geometry/IntRect.h"
38 #include "platform/geometry/LayoutRect.h" 39 #include "platform/geometry/LayoutRect.h"
39 #include "platform/graphics/Color.h" 40 #include "platform/graphics/Color.h"
40 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 41 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
41 #include "platform/scroll/ScrollTypes.h" 42 #include "platform/scroll/ScrollTypes.h"
42 #include "platform/scroll/ScrollableArea.h"
43 #include "platform/scroll/Scrollbar.h" 43 #include "platform/scroll/Scrollbar.h"
44 #include "public/platform/WebDisplayMode.h" 44 #include "public/platform/WebDisplayMode.h"
45 #include "public/platform/WebRect.h" 45 #include "public/platform/WebRect.h"
46 #include "wtf/Allocator.h" 46 #include "wtf/Allocator.h"
47 #include "wtf/Forward.h" 47 #include "wtf/Forward.h"
48 #include "wtf/HashSet.h" 48 #include "wtf/HashSet.h"
49 #include "wtf/ListHashSet.h" 49 #include "wtf/ListHashSet.h"
50 #include "wtf/OwnPtr.h" 50 #include "wtf/OwnPtr.h"
51 #include "wtf/TemporaryChange.h" 51 #include "wtf/TemporaryChange.h"
52 #include "wtf/text/WTFString.h" 52 #include "wtf/text/WTFString.h"
(...skipping 19 matching lines...) Expand all
72 class LayoutView; 72 class LayoutView;
73 class PaintInvalidationState; 73 class PaintInvalidationState;
74 class Page; 74 class Page;
75 class ScrollingCoordinator; 75 class ScrollingCoordinator;
76 class TracedValue; 76 class TracedValue;
77 struct AnnotatedRegionValue; 77 struct AnnotatedRegionValue;
78 struct CompositedSelection; 78 struct CompositedSelection;
79 79
80 typedef unsigned long long DOMTimeStamp; 80 typedef unsigned long long DOMTimeStamp;
81 81
82 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { 82 class CORE_EXPORT FrameView final : public Widget, public PaintInvalidationCapab leScrollableArea {
83 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); 83 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView);
84 84
85 friend class PaintControllerPaintTestBase; 85 friend class PaintControllerPaintTestBase;
86 friend class Internals; 86 friend class Internals;
87 friend class LayoutPart; // for invalidateTreeIfNeeded 87 friend class LayoutPart; // for invalidateTreeIfNeeded
88 88
89 public: 89 public:
90 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); 90 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*);
91 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); 91 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
92 92
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // Sets the tickmarks for the FrameView, overriding the default behavior 333 // Sets the tickmarks for the FrameView, overriding the default behavior
334 // which is to display the tickmarks corresponding to find results. 334 // which is to display the tickmarks corresponding to find results.
335 // If |m_tickmarks| is empty, the default behavior is restored. 335 // If |m_tickmarks| is empty, the default behavior is restored.
336 void setTickmarks(const Vector<IntRect>& tickmarks) 336 void setTickmarks(const Vector<IntRect>& tickmarks)
337 { 337 {
338 m_tickmarks = tickmarks; 338 m_tickmarks = tickmarks;
339 invalidatePaintForTickmarks(); 339 invalidatePaintForTickmarks();
340 } 340 }
341 341
342 void invalidatePaintForTickmarks() const; 342 void invalidatePaintForTickmarks();
343 343
344 // Since the compositor can resize the viewport due to top controls and 344 // Since the compositor can resize the viewport due to top controls and
345 // commit scroll offsets before a WebView::resize occurs, we need to adjust 345 // commit scroll offsets before a WebView::resize occurs, we need to adjust
346 // our scroll extents to prevent clamping the scroll offsets. 346 // our scroll extents to prevent clamping the scroll offsets.
347 void setTopControlsViewportAdjustment(float); 347 void setTopControlsViewportAdjustment(float);
348 IntSize topControlsSize() const { return IntSize(0, roundf(m_topControlsView portAdjustment)); } 348 IntSize topControlsSize() const { return IntSize(0, roundf(m_topControlsView portAdjustment)); }
349 349
350 IntPoint maximumScrollPosition() const override; 350 IntPoint maximumScrollPosition() const override;
351 351
352 // ScrollableArea interface 352 // ScrollableArea interface
353 void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; 353 void scrollControlWasSetNeedsPaintInvalidation() override { }
354 void getTickmarks(Vector<IntRect>&) const override; 354 void getTickmarks(Vector<IntRect>&) const override;
355 void scrollTo(const DoublePoint&); 355 void scrollTo(const DoublePoint&);
356 IntRect scrollableAreaBoundingBox() const override; 356 IntRect scrollableAreaBoundingBox() const override;
357 bool scrollAnimatorEnabled() const override; 357 bool scrollAnimatorEnabled() const override;
358 bool usesCompositedScrolling() const override; 358 bool usesCompositedScrolling() const override;
359 GraphicsLayer* layerForScrolling() const override; 359 GraphicsLayer* layerForScrolling() const override;
360 GraphicsLayer* layerForHorizontalScrollbar() const override; 360 GraphicsLayer* layerForHorizontalScrollbar() const override;
361 GraphicsLayer* layerForVerticalScrollbar() const override; 361 GraphicsLayer* layerForVerticalScrollbar() const override;
362 GraphicsLayer* layerForScrollCorner() const override; 362 GraphicsLayer* layerForScrollCorner() const override;
363 int scrollSize(ScrollbarOrientation) const override; 363 int scrollSize(ScrollbarOrientation) const override;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes. 436 IntSize scrollOffset() const { return toIntSize(visibleContentRect().locatio n()); } // Gets the scrolled position as an IntSize. Convenient for adding to ot her sizes.
437 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x (), m_scrollPosition.y()); } 437 DoubleSize scrollOffsetDouble() const { return DoubleSize(m_scrollPosition.x (), m_scrollPosition.y()); }
438 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; } 438 DoubleSize pendingScrollDelta() const { return m_pendingScrollDelta; }
439 IntPoint minimumScrollPosition() const override; // The minimum position we can be scrolled to. 439 IntPoint minimumScrollPosition() const override; // The minimum position we can be scrolled to.
440 int scrollX() const { return scrollPosition().x(); } 440 int scrollX() const { return scrollPosition().x(); }
441 int scrollY() const { return scrollPosition().y(); } 441 int scrollY() const { return scrollPosition().y(); }
442 442
443 // Scroll the actual contents of the view (either blitting or invalidating a s needed). 443 // Scroll the actual contents of the view (either blitting or invalidating a s needed).
444 void scrollContents(const IntSize& scrollDelta); 444 void scrollContents(const IntSize& scrollDelta);
445 445
446 // This gives us a means of blocking painting on our scrollbars until the fi rst layout has occurred. 446 // This gives us a means of blocking updating our scrollbars until the first layout has occurred.
447 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal se); 447 void setScrollbarsSuppressed(bool suppressed) { m_scrollbarsSuppressed = sup pressed; }
448 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } 448 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
449 449
450 // Methods for converting between this frame and other coordinate spaces. 450 // Methods for converting between this frame and other coordinate spaces.
451 // For definitions and an explanation of the varous spaces, please see: 451 // For definitions and an explanation of the varous spaces, please see:
452 // http://www.chromium.org/developers/design-documents/blink-coordinate-spac es 452 // http://www.chromium.org/developers/design-documents/blink-coordinate-spac es
453 IntPoint rootFrameToContents(const IntPoint&) const; 453 IntPoint rootFrameToContents(const IntPoint&) const;
454 FloatPoint rootFrameToContents(const FloatPoint&) const; 454 FloatPoint rootFrameToContents(const FloatPoint&) const;
455 IntRect rootFrameToContents(const IntRect&) const; 455 IntRect rootFrameToContents(const IntRect&) const;
456 IntPoint contentsToRootFrame(const IntPoint&) const; 456 IntPoint contentsToRootFrame(const IntPoint&) const;
457 IntRect contentsToRootFrame(const IntRect&) const; 457 IntRect contentsToRootFrame(const IntRect&) const;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // Scroll the content via the compositor. 582 // Scroll the content via the compositor.
583 bool scrollContentsFastPath(const IntSize& scrollDelta); 583 bool scrollContentsFastPath(const IntSize& scrollDelta);
584 584
585 // Scroll the content by invalidating everything. 585 // Scroll the content by invalidating everything.
586 void scrollContentsSlowPath(const IntRect& updateRect); 586 void scrollContentsSlowPath(const IntRect& updateRect);
587 587
588 // These functions are used to create/destroy scrollbars. 588 // These functions are used to create/destroy scrollbars.
589 void setHasHorizontalScrollbar(bool); 589 void setHasHorizontalScrollbar(bool);
590 void setHasVerticalScrollbar(bool); 590 void setHasVerticalScrollbar(bool);
591 591
592 void invalidateScrollCornerRect(const IntRect&) override;
593 ScrollBehavior scrollBehaviorStyle() const override; 592 ScrollBehavior scrollBehaviorStyle() const override;
594 593
595 void scrollContentsIfNeeded(); 594 void scrollContentsIfNeeded();
596 595
597 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP ositionSynchronously); 596 void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updateP ositionSynchronously);
598 597
599 enum ComputeScrollbarExistenceOption { 598 enum ComputeScrollbarExistenceOption {
600 FirstPass, 599 FirstPass,
601 Incremental 600 Incremental
602 }; 601 };
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 static const unsigned visualPixelThreshold = 32 * 32; 903 static const unsigned visualPixelThreshold = 32 * 32;
905 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 904 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
906 setIsVisuallyNonEmpty(); 905 setIsVisuallyNonEmpty();
907 } 906 }
908 907
909 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 908 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
910 909
911 } // namespace blink 910 } // namespace blink
912 911
913 #endif // FrameView_h 912 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698