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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 220 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
221 GL_TEXTURE_2D, texture_->PrepareTexture(), 0); | 221 GL_TEXTURE_2D, texture_->PrepareTexture(), 0); |
222 context->clearColor(0.f, 1.f, 0.f, 1.f); | 222 context->clearColor(0.f, 1.f, 0.f, 1.f); |
223 context->clear(GL_COLOR_BUFFER_BIT); | 223 context->clear(GL_COLOR_BUFFER_BIT); |
224 context->flush(); | 224 context->flush(); |
225 } | 225 } |
226 | 226 |
227 virtual ~WebGLBench() { | 227 virtual ~WebGLBench() { |
228 context_provider_->Context3d()->makeContextCurrent(); | 228 context_provider_->Context3d()->makeContextCurrent(); |
229 context_provider_->Context3d()->deleteFramebuffer(fbo_); | 229 context_provider_->Context3d()->deleteFramebuffer(fbo_); |
230 webgl_.SetExternalTexture(NULL); | 230 webgl_.SetShowPaintedContent(); |
231 texture_ = NULL; | 231 texture_ = NULL; |
232 compositor_->RemoveObserver(this); | 232 compositor_->RemoveObserver(this); |
233 } | 233 } |
234 | 234 |
235 virtual void Draw() OVERRIDE { | 235 virtual void Draw() OVERRIDE { |
236 if (do_draw_) { | 236 if (do_draw_) { |
237 WebKit::WebGraphicsContext3D* context = context_provider_->Context3d(); | 237 WebKit::WebGraphicsContext3D* context = context_provider_->Context3d(); |
238 context->makeContextCurrent(); | 238 context->makeContextCurrent(); |
239 context->clearColor((frames() % kFrames)*1.0/kFrames, 1.f, 0.f, 1.f); | 239 context->clearColor((frames() % kFrames)*1.0/kFrames, 1.f, 0.f, 1.f); |
240 context->clear(GL_COLOR_BUFFER_BIT); | 240 context->clear(GL_COLOR_BUFFER_BIT); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); | 361 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); |
362 #endif | 362 #endif |
363 | 363 |
364 root_window->ShowRootWindow(); | 364 root_window->ShowRootWindow(); |
365 base::MessageLoopForUI::current()->Run(); | 365 base::MessageLoopForUI::current()->Run(); |
366 focus_client.reset(); | 366 focus_client.reset(); |
367 root_window.reset(); | 367 root_window.reset(); |
368 | 368 |
369 return 0; | 369 return 0; |
370 } | 370 } |
OLD | NEW |