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

Side by Side Diff: cc/quads/render_pass.h

Issue 13051003: cpplint.py pass on cc/(base|debug|quads|resources)/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix prioritized_resource_unittest Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/quads/io_surface_draw_quad.cc ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_QUADS_RENDER_PASS_H_ 5 #ifndef CC_QUADS_RENDER_PASS_H_
6 #define CC_QUADS_RENDER_PASS_H_ 6 #define CC_QUADS_RENDER_PASS_H_
7 7
8 #include <utility>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
12 #include "cc/base/hash_pair.h" 13 #include "cc/base/hash_pair.h"
13 #include "cc/base/scoped_ptr_hash_map.h" 14 #include "cc/base/scoped_ptr_hash_map.h"
14 #include "cc/base/scoped_ptr_vector.h" 15 #include "cc/base/scoped_ptr_vector.h"
15 #include "skia/ext/refptr.h" 16 #include "skia/ext/refptr.h"
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h" 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h"
17 #include "third_party/skia/include/core/SkColor.h" 18 #include "third_party/skia/include/core/SkColor.h"
(...skipping 20 matching lines...) Expand all
38 }; 39 };
39 40
40 typedef ScopedPtrVector<SharedQuadState> SharedQuadStateList; 41 typedef ScopedPtrVector<SharedQuadState> SharedQuadStateList;
41 42
42 class CC_EXPORT RenderPass { 43 class CC_EXPORT RenderPass {
43 public: 44 public:
44 struct Id { 45 struct Id {
45 int layer_id; 46 int layer_id;
46 int index; 47 int index;
47 48
48 Id(int layer_id, int index) : layer_id(layer_id), index(index) {} 49 Id(int layer_id, int index) : layer_id(layer_id), index(index) {}
49 50
50 bool operator==(const Id& other) const { 51 bool operator==(const Id& other) const {
51 return layer_id == other.layer_id && index == other.index; 52 return layer_id == other.layer_id && index == other.index;
52 } 53 }
53 bool operator!=(const Id& other) const { 54 bool operator!=(const Id& other) const {
54 return !(*this == other); 55 return !(*this == other);
55 } 56 }
56 bool operator<(const Id& other) const { 57 bool operator<(const Id& other) const {
57 return layer_id < other.layer_id || 58 return layer_id < other.layer_id ||
58 (layer_id == other.layer_id && index < other.index); 59 (layer_id == other.layer_id && index < other.index);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 QuadList quad_list; 100 QuadList quad_list;
100 SharedQuadStateList shared_quad_state_list; 101 SharedQuadStateList shared_quad_state_list;
101 102
102 protected: 103 protected:
103 RenderPass(); 104 RenderPass();
104 105
105 DISALLOW_COPY_AND_ASSIGN(RenderPass); 106 DISALLOW_COPY_AND_ASSIGN(RenderPass);
106 }; 107 };
107 108
108 } // namespace cc 109 } // namespace cc
109 110
110 namespace BASE_HASH_NAMESPACE { 111 namespace BASE_HASH_NAMESPACE {
111 #if defined(COMPILER_MSVC) 112 #if defined(COMPILER_MSVC)
112 template<> 113 template<>
113 inline size_t hash_value<cc::RenderPass::Id>(const cc::RenderPass::Id& key) { 114 inline size_t hash_value<cc::RenderPass::Id>(const cc::RenderPass::Id& key) {
114 return hash_value<std::pair<int, int> >( 115 return hash_value<std::pair<int, int> >(
115 std::pair<int, int>(key.layer_id, key.index)); 116 std::pair<int, int>(key.layer_id, key.index));
116 } 117 }
117 #elif defined(COMPILER_GCC) 118 #elif defined(COMPILER_GCC)
118 template<> 119 template<>
119 struct hash<cc::RenderPass::Id> { 120 struct hash<cc::RenderPass::Id> {
120 size_t operator()(cc::RenderPass::Id key) const { 121 size_t operator()(cc::RenderPass::Id key) const {
121 return hash<std::pair<int, int> >()( 122 return hash<std::pair<int, int> >()(
122 std::pair<int, int>(key.layer_id, key.index)); 123 std::pair<int, int>(key.layer_id, key.index));
123 } 124 }
124 }; 125 };
125 #else 126 #else
126 #error define a hash function for your compiler 127 #error define a hash function for your compiler
127 #endif // COMPILER 128 #endif // COMPILER
128 } 129 }
129 130
130 namespace cc { 131 namespace cc {
131 typedef ScopedPtrVector<RenderPass> RenderPassList; 132 typedef ScopedPtrVector<RenderPass> RenderPassList;
132 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; 133 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap;
133 } // namespace cc 134 } // namespace cc
134 135
135 #endif // CC_QUADS_RENDER_PASS_H_ 136 #endif // CC_QUADS_RENDER_PASS_H_
OLDNEW
« no previous file with comments | « cc/quads/io_surface_draw_quad.cc ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698