OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Whole-tree processing that's likely to be helpful in multiple render models. | 5 // Whole-tree processing that's likely to be helpful in multiple render models. |
6 | 6 |
7 #include "gpu/tools/compositor_model_bench/render_model_utils.h" | 7 #include "gpu/tools/compositor_model_bench/render_model_utils.h" |
8 | 8 |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 | 15 |
16 TextureGenerator::TextureGenerator(RenderNode* root) | 16 TextureGenerator::TextureGenerator(RenderNode* root) |
17 : stage_(DiscoveryStage), | 17 : stage_(DiscoveryStage), |
18 tex_ids_(NULL), | |
19 image_data_(NULL), | |
20 images_generated_(0) { | 18 images_generated_(0) { |
21 DiscoverInputIDs(root); | 19 DiscoverInputIDs(root); |
22 GenerateGLTexIDs(); | 20 GenerateGLTexIDs(); |
23 AssignIDMapping(); | 21 AssignIDMapping(); |
24 WriteOutNewIDs(root); | 22 WriteOutNewIDs(root); |
25 AllocateImageArray(); | 23 AllocateImageArray(); |
26 BuildTextureImages(root); | 24 BuildTextureImages(root); |
27 } | 25 } |
28 | 26 |
29 TextureGenerator::~TextureGenerator() { | 27 TextureGenerator::~TextureGenerator() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 glTexImage2D(GL_TEXTURE_2D, | 165 glTexImage2D(GL_TEXTURE_2D, |
168 0, | 166 0, |
169 format, | 167 format, |
170 width, height, | 168 width, height, |
171 0, | 169 0, |
172 format, | 170 format, |
173 GL_UNSIGNED_BYTE, | 171 GL_UNSIGNED_BYTE, |
174 image_data_[imgID].get()); | 172 image_data_[imgID].get()); |
175 } | 173 } |
176 | 174 |
OLD | NEW |