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

Side by Side Diff: ui/views/cull_set.h

Issue 275183002: patch from issue 218843002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 7 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 | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/cull_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CULL_SET_H_
6 #define UI_VIEWS_CULL_SET_H_
7
8 #include "base/containers/hash_tables.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/views/views_export.h"
12
13 namespace views {
14
15 class View;
16
17 // A CullSet defines a set of View pointers which have been possibly culled
18 // from painting or other bounds-checking operations. It wraps a set of
19 // pointers to views, or NULL if no such set is available.
20 class VIEWS_EXPORT CullSet {
21 public:
22 // Default constructor builds a CullSet that will always return true for
23 // ShouldPaint().
24 CullSet();
25 ~CullSet();
26
27 // Wraps a set of pointers to Views, as might be provided by
28 // gfx::RTree::Query(), that intersect the damage rect and therefore need
29 // to be painted. CullSet takes ownership of the provided pointer.
30 CullSet(scoped_ptr<base::hash_set<intptr_t> > cull_set);
31
32 // Returns true if |view| needs to be painted.
33 bool ShouldPaint(const View* view) const;
34
35 private:
36 friend class BoundsTreeTestView;
37
38 // The set of Views that collided with the query rectangle provided to the
39 // RTree data structure, or NULL if one is not available.
40 scoped_ptr<base::hash_set<intptr_t> > cull_set_;
41
42 DISALLOW_COPY_AND_ASSIGN(CullSet);
43 };
44
45 } // namespace views
46
47 #endif // UI_VIEWS_CULL_SET_H_
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/cull_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698