| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 if (!width || !height) { | 202 if (!width || !height) { |
| 203 width = 800; | 203 width = 800; |
| 204 height = 600; | 204 height = 600; |
| 205 } | 205 } |
| 206 gfx::Rect bounds(width, height); | 206 gfx::Rect bounds(width, height); |
| 207 webgl_.SetBounds(bounds); | 207 webgl_.SetBounds(bounds); |
| 208 parent_->Add(&webgl_); | 208 parent_->Add(&webgl_); |
| 209 | 209 |
| 210 context_.reset(ui::ContextFactory::GetInstance()->CreateOffscreenContext()); | 210 context_ = ui::ContextFactory::GetInstance()->CreateOffscreenContext(); |
| 211 context_->makeContextCurrent(); | 211 context_->makeContextCurrent(); |
| 212 texture_ = new WebGLTexture(context_.get(), bounds.size()); | 212 texture_ = new WebGLTexture(context_.get(), bounds.size()); |
| 213 fbo_ = context_->createFramebuffer(); | 213 fbo_ = context_->createFramebuffer(); |
| 214 compositor->AddObserver(this); | 214 compositor->AddObserver(this); |
| 215 webgl_.SetExternalTexture(texture_.get()); | 215 webgl_.SetExternalTexture(texture_.get()); |
| 216 context_->bindFramebuffer(GL_FRAMEBUFFER, fbo_); | 216 context_->bindFramebuffer(GL_FRAMEBUFFER, fbo_); |
| 217 context_->framebufferTexture2D( | 217 context_->framebufferTexture2D( |
| 218 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 218 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 219 GL_TEXTURE_2D, texture_->PrepareTexture(), 0); | 219 GL_TEXTURE_2D, texture_->PrepareTexture(), 0); |
| 220 context_->clearColor(0.f, 1.f, 0.f, 1.f); | 220 context_->clearColor(0.f, 1.f, 0.f, 1.f); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); | 354 ui::PrintLayerHierarchy(root_window->layer(), gfx::Point(100, 100)); |
| 355 #endif | 355 #endif |
| 356 | 356 |
| 357 root_window->ShowRootWindow(); | 357 root_window->ShowRootWindow(); |
| 358 base::MessageLoopForUI::current()->Run(); | 358 base::MessageLoopForUI::current()->Run(); |
| 359 focus_client.reset(); | 359 focus_client.reset(); |
| 360 root_window.reset(); | 360 root_window.reset(); |
| 361 | 361 |
| 362 return 0; | 362 return 0; |
| 363 } | 363 } |
| OLD | NEW |