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

Side by Side Diff: third_party/WebKit/Source/platform/Widget.h

Issue 1422493003: Change Widget subclasses to use a CullRect instead of an IntRect for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora Ltd. All rights reserved. 3 * Copyright (C) 2008 Collabora Ltd. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 20 matching lines...) Expand all
31 #include "platform/PlatformExport.h" 31 #include "platform/PlatformExport.h"
32 #include "platform/geometry/FloatPoint.h" 32 #include "platform/geometry/FloatPoint.h"
33 #include "platform/geometry/IntRect.h" 33 #include "platform/geometry/IntRect.h"
34 #include "platform/heap/Handle.h" 34 #include "platform/heap/Handle.h"
35 #include "public/platform/WebFocusType.h" 35 #include "public/platform/WebFocusType.h"
36 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
37 #include "wtf/RefCounted.h" 37 #include "wtf/RefCounted.h"
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class CullRect;
41 class Event; 42 class Event;
42 class GraphicsContext; 43 class GraphicsContext;
43 class HostWindow; 44 class HostWindow;
44 45
45 // The Widget class serves as a base class for FrameView, Scrollbar, and PluginV iew. 46 // The Widget class serves as a base class for FrameView, Scrollbar, and PluginV iew.
46 // 47 //
47 // Widgets are connected in a hierarchy, with the restriction that plugins and 48 // Widgets are connected in a hierarchy, with the restriction that plugins and
48 // scrollbars are always leaves of the tree. Only FrameView can have children 49 // scrollbars are always leaves of the tree. Only FrameView can have children
49 // (and therefore the Widget class has no concept of children). 50 // (and therefore the Widget class has no concept of children).
50 class PLATFORM_EXPORT Widget : public RefCountedWillBeGarbageCollectedFinalized< Widget> { 51 class PLATFORM_EXPORT Widget : public RefCountedWillBeGarbageCollectedFinalized< Widget> {
(...skipping 10 matching lines...) Expand all
61 62
62 virtual void setFrameRect(const IntRect& frame) { m_frame = frame; } 63 virtual void setFrameRect(const IntRect& frame) { m_frame = frame; }
63 const IntRect& frameRect() const { return m_frame; } 64 const IntRect& frameRect() const { return m_frame; }
64 IntRect boundsRect() const { return IntRect(0, 0, width(), height()); } 65 IntRect boundsRect() const { return IntRect(0, 0, width(), height()); }
65 66
66 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); } 67 void resize(int w, int h) { setFrameRect(IntRect(x(), y(), w, h)); }
67 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); } 68 void resize(const IntSize& s) { setFrameRect(IntRect(location(), s)); }
68 void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); } 69 void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); }
69 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); } 70 void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); }
70 71
71 virtual void paint(GraphicsContext*, const IntRect&) const { } 72 virtual void paint(GraphicsContext*, const CullRect&) const { }
72 void invalidate() { invalidateRect(boundsRect()); } 73 void invalidate() { invalidateRect(boundsRect()); }
73 virtual void invalidateRect(const IntRect&) = 0; 74 virtual void invalidateRect(const IntRect&) = 0;
74 75
75 virtual void setFocus(bool, WebFocusType) { } 76 virtual void setFocus(bool, WebFocusType) { }
76 77
77 virtual void show() { } 78 virtual void show() { }
78 virtual void hide() { } 79 virtual void hide() { }
79 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha ve been explicitly marked as visible or not. 80 bool isSelfVisible() const { return m_selfVisible; } // Whether or not we ha ve been explicitly marked as visible or not.
80 bool isParentVisible() const { return m_parentVisible; } // Whether or not o ur parent is visible. 81 bool isParentVisible() const { return m_parentVisible; } // Whether or not o ur parent is visible.
81 bool isVisible() const { return m_selfVisible && m_parentVisible; } // Wheth er or not we are actually visible. 82 bool isVisible() const { return m_selfVisible && m_parentVisible; } // Wheth er or not we are actually visible.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 private: 131 private:
131 RawPtrWillBeMember<Widget> m_parent; 132 RawPtrWillBeMember<Widget> m_parent;
132 IntRect m_frame; 133 IntRect m_frame;
133 bool m_selfVisible; 134 bool m_selfVisible;
134 bool m_parentVisible; 135 bool m_parentVisible;
135 }; 136 };
136 137
137 } // namespace blink 138 } // namespace blink
138 139
139 #endif // Widget_h 140 #endif // Widget_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698