| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Data structures for representing parts of Chromium's composited layer tree | 5 // Data structures for representing parts of Chromium's composited layer tree |
| 6 // and a function to load it from the JSON configuration file | 6 // and a function to load it from the JSON configuration file |
| 7 | 7 |
| 8 #ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ | 8 #ifndef GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ |
| 9 #define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ | 9 #define GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ |
| 10 | 10 |
| 11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 | 12 |
| 13 #include <memory> |
| 13 #include <string> | 14 #include <string> |
| 14 #include <vector> | 15 #include <vector> |
| 15 | 16 |
| 16 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/ptr_util.h" |
| 18 #include "gpu/tools/compositor_model_bench/shaders.h" | 19 #include "gpu/tools/compositor_model_bench/shaders.h" |
| 19 #include "ui/gl/gl_bindings.h" | 20 #include "ui/gl/gl_bindings.h" |
| 20 #include "ui/gl/gl_implementation.h" | 21 #include "ui/gl/gl_implementation.h" |
| 21 | 22 |
| 22 // These are fairly arbitrary values based on how big my actual browser | 23 // These are fairly arbitrary values based on how big my actual browser |
| 23 // window was. | 24 // window was. |
| 24 const int WINDOW_WIDTH = 1609; | 25 const int WINDOW_WIDTH = 1609; |
| 25 const int WINDOW_HEIGHT = 993; | 26 const int WINDOW_HEIGHT = 993; |
| 26 | 27 |
| 27 struct Tile { | 28 struct Tile { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 public: | 140 public: |
| 140 ContentLayerNode(); | 141 ContentLayerNode(); |
| 141 ~ContentLayerNode() override; | 142 ~ContentLayerNode() override; |
| 142 void Accept(RenderNodeVisitor* v) override; | 143 void Accept(RenderNodeVisitor* v) override; |
| 143 | 144 |
| 144 void set_skipsDraw(bool skips) { | 145 void set_skipsDraw(bool skips) { |
| 145 skipsDraw_ = skips; | 146 skipsDraw_ = skips; |
| 146 } | 147 } |
| 147 | 148 |
| 148 void add_child(RenderNode* child) { | 149 void add_child(RenderNode* child) { |
| 149 children_.push_back(make_scoped_ptr(child)); | 150 children_.push_back(base::WrapUnique(child)); |
| 150 } | 151 } |
| 151 | 152 |
| 152 private: | 153 private: |
| 153 std::vector<scoped_ptr<RenderNode>> children_; | 154 std::vector<std::unique_ptr<RenderNode>> children_; |
| 154 bool skipsDraw_; | 155 bool skipsDraw_; |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 class CCNode : public RenderNode { | 158 class CCNode : public RenderNode { |
| 158 public: | 159 public: |
| 159 CCNode(); | 160 CCNode(); |
| 160 ~CCNode() override; | 161 ~CCNode() override; |
| 161 | 162 |
| 162 void Accept(RenderNodeVisitor* v) override; | 163 void Accept(RenderNodeVisitor* v) override; |
| 163 | 164 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 virtual void BeginVisitCCNode(CCNode* v); | 205 virtual void BeginVisitCCNode(CCNode* v); |
| 205 virtual void EndVisitRenderNode(RenderNode* v); | 206 virtual void EndVisitRenderNode(RenderNode* v); |
| 206 virtual void EndVisitContentLayerNode(ContentLayerNode* v); | 207 virtual void EndVisitContentLayerNode(ContentLayerNode* v); |
| 207 virtual void EndVisitCCNode(CCNode* v); | 208 virtual void EndVisitCCNode(CCNode* v); |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 RenderNode* BuildRenderTreeFromFile(const base::FilePath& path); | 211 RenderNode* BuildRenderTreeFromFile(const base::FilePath& path); |
| 211 | 212 |
| 212 #endif // GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ | 213 #endif // GPU_TOOLS_COMPOSITOR_MODEL_BENCH_RENDER_TREE_H_ |
| 213 | 214 |
| OLD | NEW |