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

Side by Side Diff: sky/engine/core/rendering/RenderSelectionInfo.h

Issue 840403003: First pass at deleting paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 RenderObject* object() const { return m_object; } 50 RenderObject* object() const { return m_object; }
51 const RenderLayerModelObject* paintInvalidationContainer() const { return m_ paintInvalidationContainer; } 51 const RenderLayerModelObject* paintInvalidationContainer() const { return m_ paintInvalidationContainer; }
52 RenderObject::SelectionState state() const { return m_state; } 52 RenderObject::SelectionState state() const { return m_state; }
53 53
54 protected: 54 protected:
55 RawPtr<RenderObject> m_object; 55 RawPtr<RenderObject> m_object;
56 RawPtr<const RenderLayerModelObject> m_paintInvalidationContainer; 56 RawPtr<const RenderLayerModelObject> m_paintInvalidationContainer;
57 RenderObject::SelectionState m_state; 57 RenderObject::SelectionState m_state;
58 }; 58 };
59 59
60 // FIXME(sky): Remove this class.
60 // This struct is used when the selection changes to cache the old and new state of the selection for each RenderObject. 61 // This struct is used when the selection changes to cache the old and new state of the selection for each RenderObject.
61 class RenderSelectionInfo final : public RenderSelectionInfoBase { 62 class RenderSelectionInfo final : public RenderSelectionInfoBase {
62 public: 63 public:
63 RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent) 64 RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent)
64 : RenderSelectionInfoBase(o) 65 : RenderSelectionInfoBase(o)
65 { 66 {
66 if (o->canUpdateSelectionOnRootLineBoxes()) { 67 if (o->canUpdateSelectionOnRootLineBoxes()) {
67 m_rect = o->selectionRectForPaintInvalidation(m_paintInvalidationCon tainer, clipToVisibleContent); 68 m_rect = o->selectionRectForPaintInvalidation(m_paintInvalidationCon tainer, clipToVisibleContent);
68 } else { 69 } else {
69 m_rect = LayoutRect(); 70 m_rect = LayoutRect();
70 } 71 }
71 } 72 }
72 73
73 void invalidatePaint() 74 void invalidatePaint()
74 { 75 {
75 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, en closingIntRect(m_rect), InvalidationSelection);
76 } 76 }
77 77
78 LayoutRect rect() const { return m_rect; } 78 LayoutRect rect() const { return m_rect; }
79 79
80 private: 80 private:
81 LayoutRect m_rect; // relative to paint invalidation container 81 LayoutRect m_rect; // relative to paint invalidation container
82 }; 82 };
83 83
84 // FIXME(sky): Remove this class.
84 // This struct is used when the selection changes to cache the old and new state of the selection for each RenderBlock. 85 // This struct is used when the selection changes to cache the old and new state of the selection for each RenderBlock.
85 class RenderBlockSelectionInfo final : public RenderSelectionInfoBase { 86 class RenderBlockSelectionInfo final : public RenderSelectionInfoBase {
86 public: 87 public:
87 RenderBlockSelectionInfo(RenderBlock* b) 88 RenderBlockSelectionInfo(RenderBlock* b)
88 : RenderSelectionInfoBase(b) 89 : RenderSelectionInfoBase(b)
89 { 90 {
90 if (b->canUpdateSelectionOnRootLineBoxes()) 91 if (b->canUpdateSelectionOnRootLineBoxes())
91 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva lidationContainer); 92 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva lidationContainer);
92 else 93 else
93 m_rects = GapRects(); 94 m_rects = GapRects();
94 } 95 }
95 96
96 void invalidatePaint() 97 void invalidatePaint()
97 { 98 {
98 m_object->invalidatePaintUsingContainer(m_paintInvalidationContainer, en closingIntRect(m_rects), InvalidationSelection);
99 } 99 }
100 100
101 RenderBlock* block() const { return toRenderBlock(m_object); } 101 RenderBlock* block() const { return toRenderBlock(m_object); }
102 GapRects rects() const { return m_rects; } 102 GapRects rects() const { return m_rects; }
103 103
104 private: 104 private:
105 GapRects m_rects; // relative to paint invalidation container 105 GapRects m_rects; // relative to paint invalidation container
106 }; 106 };
107 107
108 } // namespace blink 108 } // namespace blink
109 109
110 110
111 #endif // SKY_ENGINE_CORE_RENDERING_RENDERSELECTIONINFO_H_ 111 #endif // SKY_ENGINE_CORE_RENDERING_RENDERSELECTIONINFO_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObjectChildList.cpp ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698