| OLD | NEW |
| 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 | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 8 reserved. | 8 reserved. |
| 9 | 9 |
| 10 This library is free software; you can redistribute it and/or | 10 This library is free software; you can redistribute it and/or |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/frame/FrameViewAutoSizeInfo.h" | 33 #include "core/frame/FrameViewAutoSizeInfo.h" |
| 34 #include "core/frame/LayoutSubtreeRootList.h" | 34 #include "core/frame/LayoutSubtreeRootList.h" |
| 35 #include "core/frame/RootFrameViewport.h" | 35 #include "core/frame/RootFrameViewport.h" |
| 36 #include "core/layout/MapCoordinatesFlags.h" | 36 #include "core/layout/MapCoordinatesFlags.h" |
| 37 #include "core/layout/ScrollAnchor.h" | 37 #include "core/layout/ScrollAnchor.h" |
| 38 #include "core/paint/FirstMeaningfulPaintDetector.h" | 38 #include "core/paint/FirstMeaningfulPaintDetector.h" |
| 39 #include "core/paint/ObjectPaintProperties.h" | 39 #include "core/paint/ObjectPaintProperties.h" |
| 40 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 40 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
| 41 #include "core/paint/PaintPhase.h" | 41 #include "core/paint/PaintPhase.h" |
| 42 #include "core/paint/ScrollbarManager.h" | 42 #include "core/paint/ScrollbarManager.h" |
| 43 #include "platform/FrameViewBase.h" | |
| 44 #include "platform/RuntimeEnabledFeatures.h" | 43 #include "platform/RuntimeEnabledFeatures.h" |
| 45 #include "platform/animation/CompositorAnimationHost.h" | 44 #include "platform/animation/CompositorAnimationHost.h" |
| 46 #include "platform/animation/CompositorAnimationTimeline.h" | 45 #include "platform/animation/CompositorAnimationTimeline.h" |
| 47 #include "platform/geometry/IntRect.h" | 46 #include "platform/geometry/IntRect.h" |
| 48 #include "platform/geometry/LayoutRect.h" | 47 #include "platform/geometry/LayoutRect.h" |
| 49 #include "platform/graphics/Color.h" | 48 #include "platform/graphics/Color.h" |
| 50 #include "platform/graphics/CompositorElementId.h" | 49 #include "platform/graphics/CompositorElementId.h" |
| 51 #include "platform/graphics/GraphicsLayerClient.h" | 50 #include "platform/graphics/GraphicsLayerClient.h" |
| 52 #include "platform/scroll/ScrollTypes.h" | 51 #include "platform/scroll/ScrollTypes.h" |
| 53 #include "platform/scroll/Scrollbar.h" | 52 #include "platform/scroll/Scrollbar.h" |
| 53 #include "platform/scroll/ScrollbarParent.h" |
| 54 #include "platform/wtf/Allocator.h" | 54 #include "platform/wtf/Allocator.h" |
| 55 #include "platform/wtf/AutoReset.h" | 55 #include "platform/wtf/AutoReset.h" |
| 56 #include "platform/wtf/Forward.h" | 56 #include "platform/wtf/Forward.h" |
| 57 #include "platform/wtf/HashSet.h" | 57 #include "platform/wtf/HashSet.h" |
| 58 #include "platform/wtf/ListHashSet.h" | 58 #include "platform/wtf/ListHashSet.h" |
| 59 #include "platform/wtf/text/WTFString.h" | 59 #include "platform/wtf/text/WTFString.h" |
| 60 #include "public/platform/ShapeProperties.h" | 60 #include "public/platform/ShapeProperties.h" |
| 61 #include "public/platform/WebDisplayMode.h" | 61 #include "public/platform/WebDisplayMode.h" |
| 62 #include "public/platform/WebRect.h" | 62 #include "public/platform/WebRect.h" |
| 63 | 63 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 class ScrollingCoordinator; | 95 class ScrollingCoordinator; |
| 96 class TracedValue; | 96 class TracedValue; |
| 97 class TransformState; | 97 class TransformState; |
| 98 struct AnnotatedRegionValue; | 98 struct AnnotatedRegionValue; |
| 99 struct CompositedSelection; | 99 struct CompositedSelection; |
| 100 | 100 |
| 101 typedef unsigned long long DOMTimeStamp; | 101 typedef unsigned long long DOMTimeStamp; |
| 102 | 102 |
| 103 class CORE_EXPORT FrameView final | 103 class CORE_EXPORT FrameView final |
| 104 : public GarbageCollectedFinalized<FrameView>, | 104 : public GarbageCollectedFinalized<FrameView>, |
| 105 public FrameViewBase, | 105 public ScrollbarParent, |
| 106 public FrameOrPlugin, | 106 public FrameOrPlugin, |
| 107 public PaintInvalidationCapableScrollableArea { | 107 public PaintInvalidationCapableScrollableArea { |
| 108 USING_GARBAGE_COLLECTED_MIXIN(FrameView); | 108 USING_GARBAGE_COLLECTED_MIXIN(FrameView); |
| 109 | 109 |
| 110 friend class PaintControllerPaintTestBase; | 110 friend class PaintControllerPaintTestBase; |
| 111 friend class Internals; | 111 friend class Internals; |
| 112 friend class LayoutPart; // for invalidateTreeIfNeeded | 112 friend class LayoutPart; // for invalidateTreeIfNeeded |
| 113 | 113 |
| 114 public: | 114 public: |
| 115 static FrameView* Create(LocalFrame&); | 115 static FrameView* Create(LocalFrame&); |
| 116 static FrameView* Create(LocalFrame&, const IntSize& initial_size); | 116 static FrameView* Create(LocalFrame&, const IntSize& initial_size); |
| 117 | 117 |
| 118 ~FrameView() override; | 118 ~FrameView() override; |
| 119 | 119 |
| 120 void Invalidate() { InvalidateRect(IntRect(0, 0, Width(), Height())); } | 120 void Invalidate() { InvalidateRect(IntRect(0, 0, Width(), Height())); } |
| 121 void InvalidateRect(const IntRect&); | 121 void InvalidateRect(const IntRect&); |
| 122 void SetFrameRect(const IntRect&) override; | 122 void SetFrameRect(const IntRect&) override; |
| 123 const IntRect& FrameRect() const override { return frame_rect_; } | 123 const IntRect& FrameRect() const override { return frame_rect_; } |
| 124 int X() const { return frame_rect_.X(); } | 124 int X() const { return frame_rect_.X(); } |
| 125 int Y() const { return frame_rect_.Y(); } | 125 int Y() const { return frame_rect_.Y(); } |
| 126 int Width() const { return frame_rect_.Width(); } | 126 int Width() const { return frame_rect_.Width(); } |
| 127 int Height() const { return frame_rect_.Height(); } | 127 int Height() const { return frame_rect_.Height(); } |
| 128 IntSize Size() const { return frame_rect_.Size(); } | 128 IntSize Size() const { return frame_rect_.Size(); } |
| 129 IntPoint Location() const override { return frame_rect_.Location(); } | 129 IntPoint Location() const { return frame_rect_.Location(); } |
| 130 void Resize(int width, int height) { | 130 void Resize(int width, int height) { |
| 131 SetFrameRect(IntRect(frame_rect_.X(), frame_rect_.Y(), width, height)); | 131 SetFrameRect(IntRect(frame_rect_.X(), frame_rect_.Y(), width, height)); |
| 132 } | 132 } |
| 133 void Resize(const IntSize& size) { SetFrameRect(IntRect(Location(), size)); } | 133 void Resize(const IntSize& size) { SetFrameRect(IntRect(Location(), size)); } |
| 134 | 134 |
| 135 LocalFrame& GetFrame() const { | 135 LocalFrame& GetFrame() const { |
| 136 ASSERT(frame_); | 136 ASSERT(frame_); |
| 137 return *frame_; | 137 return *frame_; |
| 138 } | 138 } |
| 139 | 139 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 642 |
| 643 // Functions for converting to screen coordinates. | 643 // Functions for converting to screen coordinates. |
| 644 IntRect ContentsToScreen(const IntRect&) const; | 644 IntRect ContentsToScreen(const IntRect&) const; |
| 645 | 645 |
| 646 // For platforms that need to hit test scrollbars from within the engine's | 646 // For platforms that need to hit test scrollbars from within the engine's |
| 647 // event handlers (like Win32). | 647 // event handlers (like Win32). |
| 648 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); | 648 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); |
| 649 | 649 |
| 650 IntRect ConvertToRootFrame(const IntRect&) const; | 650 IntRect ConvertToRootFrame(const IntRect&) const; |
| 651 IntPoint ConvertToRootFrame(const IntPoint&) const; | 651 IntPoint ConvertToRootFrame(const IntPoint&) const; |
| 652 IntRect ConvertFromRootFrame(const IntRect&) const; |
| 653 IntPoint ConvertFromRootFrame(const IntPoint&) const; |
| 654 FloatPoint ConvertFromRootFrame(const FloatPoint&) const; |
| 655 IntPoint ConvertPointFromRootFrame(const IntPoint& point) const override { |
| 656 return ConvertFromRootFrame(point); |
| 657 } |
| 652 IntPoint ConvertSelfToChild(const IntPoint&, const IntPoint&) const; | 658 IntPoint ConvertSelfToChild(const IntPoint&, const IntPoint&) const; |
| 653 | 659 |
| 654 // Handles painting of the contents of the view as well as the scrollbars. | 660 // Handles painting of the contents of the view as well as the scrollbars. |
| 655 void Paint(GraphicsContext&, const CullRect&) const override; | 661 void Paint(GraphicsContext&, const CullRect&) const override; |
| 656 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; | 662 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; |
| 657 void PaintContents(GraphicsContext&, | 663 void PaintContents(GraphicsContext&, |
| 658 const GlobalPaintFlags, | 664 const GlobalPaintFlags, |
| 659 const IntRect& damage_rect) const; | 665 const IntRect& damage_rect) const; |
| 660 | 666 |
| 661 void Show() override; | 667 void Show() override; |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 return; | 1261 return; |
| 1256 visually_non_empty_pixel_count_ += size.Area(); | 1262 visually_non_empty_pixel_count_ += size.Area(); |
| 1257 // Use a threshold value to prevent very small amounts of visible content from | 1263 // Use a threshold value to prevent very small amounts of visible content from |
| 1258 // triggering didMeaningfulLayout. | 1264 // triggering didMeaningfulLayout. |
| 1259 static const unsigned kVisualPixelThreshold = 32 * 32; | 1265 static const unsigned kVisualPixelThreshold = 32 * 32; |
| 1260 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) | 1266 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) |
| 1261 SetIsVisuallyNonEmpty(); | 1267 SetIsVisuallyNonEmpty(); |
| 1262 } | 1268 } |
| 1263 | 1269 |
| 1264 DEFINE_TYPE_CASTS(FrameView, | 1270 DEFINE_TYPE_CASTS(FrameView, |
| 1265 FrameViewBase, | |
| 1266 frameViewBase, | |
| 1267 frameViewBase->IsFrameView(), | |
| 1268 frameViewBase.IsFrameView()); | |
| 1269 DEFINE_TYPE_CASTS(FrameView, | |
| 1270 FrameOrPlugin, | 1271 FrameOrPlugin, |
| 1271 frame_or_plugin, | 1272 frame_or_plugin, |
| 1272 frame_or_plugin->IsFrameView(), | 1273 frame_or_plugin->IsFrameView(), |
| 1273 frame_or_plugin.IsFrameView()); | 1274 frame_or_plugin.IsFrameView()); |
| 1274 DEFINE_TYPE_CASTS(FrameView, | 1275 DEFINE_TYPE_CASTS(FrameView, |
| 1275 ScrollableArea, | 1276 ScrollableArea, |
| 1276 scrollable_area, | 1277 scrollable_area, |
| 1277 scrollable_area->IsFrameView(), | 1278 scrollable_area->IsFrameView(), |
| 1278 scrollable_area.IsFrameView()); | 1279 scrollable_area.IsFrameView()); |
| 1279 | 1280 |
| 1280 } // namespace blink | 1281 } // namespace blink |
| 1281 | 1282 |
| 1282 #endif // FrameView_h | 1283 #endif // FrameView_h |
| OLD | NEW |