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 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/i18n/icu_util.h" | 8 #include "base/i18n/icu_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 context_->bindTexture(GL_TEXTURE_2D, texture_id()); | 135 context_->bindTexture(GL_TEXTURE_2D, texture_id()); |
136 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 136 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
137 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 137 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
138 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 138 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
139 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 139 context_->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
140 context_->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, | 140 context_->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, |
141 size.width(), size.height(), 0, | 141 size.width(), size.height(), 0, |
142 GL_RGBA, GL_UNSIGNED_BYTE, NULL); | 142 GL_RGBA, GL_UNSIGNED_BYTE, NULL); |
143 } | 143 } |
144 | 144 |
| 145 private: |
145 virtual ~WebGLTexture() { | 146 virtual ~WebGLTexture() { |
146 context_->deleteTexture(texture_id()); | 147 context_->deleteTexture(texture_id()); |
147 } | 148 } |
148 | 149 |
149 private: | |
150 WebGraphicsContext3D* context_; | 150 WebGraphicsContext3D* context_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(WebGLTexture); | 152 DISALLOW_COPY_AND_ASSIGN(WebGLTexture); |
153 }; | 153 }; |
154 | 154 |
155 // A benchmark that adds a texture layer that is updated every frame. | 155 // A benchmark that adds a texture layer that is updated every frame. |
156 class WebGLBench : public BenchCompositorObserver { | 156 class WebGLBench : public BenchCompositorObserver { |
157 public: | 157 public: |
158 WebGLBench(Layer* parent, Compositor* compositor, int max_frames) | 158 WebGLBench(Layer* parent, Compositor* compositor, int max_frames) |
159 : BenchCompositorObserver(max_frames), | 159 : BenchCompositorObserver(max_frames), |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 #endif | 329 #endif |
330 | 330 |
331 root_window->ShowRootWindow(); | 331 root_window->ShowRootWindow(); |
332 MessageLoopForUI::current()->Run(); | 332 MessageLoopForUI::current()->Run(); |
333 root_window.reset(); | 333 root_window.reset(); |
334 | 334 |
335 ui::CompositorTestSupport::Terminate(); | 335 ui::CompositorTestSupport::Terminate(); |
336 | 336 |
337 return 0; | 337 return 0; |
338 } | 338 } |
OLD | NEW |