Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: ui/aura/bench/bench_main.cc

Issue 17447007: Change WGC3DInProcessCBImpl factories to return a base class pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/client/gl_helper_unittests.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/gl_helper_unittests.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698