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

Side by Side Diff: cc/base/pyramid_sequence.h

Issue 2067213002: cc: Implement tile iteration order based on pyramid sequence. [old] Base URL: https://chromium.googlesource.com/chromium/src.git@tiling_data_fix
Patch Set: tild Created 4 years, 6 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
(Empty)
1 // Copyright 2016 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 CC_BASE_PYRAMID_SEQUENCE_H_
6 #define CC_BASE_PYRAMID_SEQUENCE_H_
7
8 #include "base/logging.h"
9 #include "cc/base/cc_export.h"
10
11 namespace cc {
12
13 class CC_EXPORT PyramidSequence {
vmpstr 2016/06/16 18:28:58 Can you put a comprehensive comment here explainin
14 public:
15 enum class Type : uint16_t {
16 FORWARD,
17 BACKWARD,
18 DIAGONAL_FORWARD,
19 DIAGONAL_BACKWARD
20 };
21
22 PyramidSequence(Type type, int start, int end, int levels);
vmpstr 2016/06/16 18:28:58 This needs a comment to explain what each variable
23 ~PyramidSequence();
24
25 int GetCurrent();
vmpstr 2016/06/16 18:28:58 Name this better... GetCurrent what?
26 int GetCoverage();
27 bool within_bounds() { return within_bounds_; }
vmpstr 2016/06/16 18:28:58 is_within_bounds
28 void Advance();
29
30 private:
31 typedef void (PyramidSequence::*InflateFn)();
vmpstr 2016/06/16 18:28:58 using InflateFn = void (PyramidSequence::*)();
32 typedef bool (PyramidSequence::*IsWithinBoundsFn)();
33
34 void Init(Type type);
35 void Reset();
36
37 void InflateForward();
38 bool IsWithinBoundsForward();
39 void InflateBackward();
40 bool IsWithinBoundsBackward();
41 void InflateDiagonalForward();
42 bool IsWithinBoundsDiagonalForward();
43 void InflateDiagonalBackward();
44 bool IsWithinBoundsDiagonalBackward();
45
46 int start_;
47 int end_;
48 int levels_;
49 int levels_traversed_;
50 bool within_bounds_;
51 int current_;
52 int step_;
53
54 InflateFn inflater_;
vmpstr 2016/06/16 18:28:58 I'd call this "inflate_" and "determine_within_bou
55 IsWithinBoundsFn within_bounds_checker_;
56 };
57
58 } // namespace cc
59
60 #endif // CC_BASE_PYRAMID_SEQUENCE_H_
OLDNEW
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/base/pyramid_sequence.cc » ('j') | cc/base/pyramid_sequence.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698