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

Side by Side Diff: cc/output/filter_operations.h

Issue 1867913002: Implement cc::FilterOperations::MapRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU: <numeric> Created 4 years, 8 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_FILTER_OPERATIONS_H_ 5 #ifndef CC_OUTPUT_FILTER_OPERATIONS_H_
6 #define CC_OUTPUT_FILTER_OPERATIONS_H_ 6 #define CC_OUTPUT_FILTER_OPERATIONS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "cc/output/filter_operation.h" 14 #include "cc/output/filter_operation.h"
15 15
16 namespace base { 16 namespace base {
17 namespace trace_event { 17 namespace trace_event {
18 class TracedValue; 18 class TracedValue;
19 } 19 }
20 class Value; 20 class Value;
21 } 21 }
22 22
23 namespace gfx {
24 class Rect;
25 }
26
23 namespace cc { 27 namespace cc {
24 28
25 // An ordered list of filter operations. 29 // An ordered list of filter operations.
26 class CC_EXPORT FilterOperations { 30 class CC_EXPORT FilterOperations {
27 public: 31 public:
28 FilterOperations(); 32 FilterOperations();
29 33
30 FilterOperations(const FilterOperations& other); 34 FilterOperations(const FilterOperations& other);
31 35
32 ~FilterOperations(); 36 ~FilterOperations();
33 37
34 FilterOperations& operator=(const FilterOperations& other); 38 FilterOperations& operator=(const FilterOperations& other);
35 39
36 bool operator==(const FilterOperations& other) const; 40 bool operator==(const FilterOperations& other) const;
37 41
38 bool operator!=(const FilterOperations& other) const { 42 bool operator!=(const FilterOperations& other) const {
39 return !(*this == other); 43 return !(*this == other);
40 } 44 }
41 45
42 void Append(const FilterOperation& filter); 46 void Append(const FilterOperation& filter);
43 47
44 // Removes all filter operations. 48 // Removes all filter operations.
45 void Clear(); 49 void Clear();
46 50
47 bool IsEmpty() const; 51 bool IsEmpty() const;
48 52
53 // Maps "forward" to determine which pixels in a destination rect are affected
54 // by pixels in the source rect.
55 gfx::Rect MapRect(const gfx::Rect& rect) const;
56
49 void GetOutsets(int* top, int* right, int* bottom, int* left) const; 57 void GetOutsets(int* top, int* right, int* bottom, int* left) const;
Stephen White 2016/04/11 18:05:00 Do we still need this?
jbroman 2016/04/11 20:21:52 Yes. None of the call sites have been rewritten ye
50 bool HasFilterThatMovesPixels() const; 58 bool HasFilterThatMovesPixels() const;
51 bool HasFilterThatAffectsOpacity() const; 59 bool HasFilterThatAffectsOpacity() const;
52 bool HasReferenceFilter() const; 60 bool HasReferenceFilter() const;
53 61
54 size_t size() const { 62 size_t size() const {
55 return operations_.size(); 63 return operations_.size();
56 } 64 }
57 65
58 const FilterOperation& at(size_t index) const { 66 const FilterOperation& at(size_t index) const {
59 DCHECK_LT(index, size()); 67 DCHECK_LT(index, size());
(...skipping 14 matching lines...) Expand all
74 82
75 void AsValueInto(base::trace_event::TracedValue* value) const; 83 void AsValueInto(base::trace_event::TracedValue* value) const;
76 84
77 private: 85 private:
78 std::vector<FilterOperation> operations_; 86 std::vector<FilterOperation> operations_;
79 }; 87 };
80 88
81 } // namespace cc 89 } // namespace cc
82 90
83 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_ 91 #endif // CC_OUTPUT_FILTER_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698