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

Side by Side Diff: ui/gfx/compositor/compositor_gl.cc

Issue 7104039: First draft to enable turning off compositor for unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revised to add conditional compilation guards. Created 9 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 | « chrome/test/unit/chrome_test_suite.cc ('k') | views/run_all_unittests.cc » ('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) 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 #include "ui/gfx/compositor/compositor.h" 5 #include "ui/gfx/compositor/compositor.h"
6 6
7 #include <GL/gl.h> 7 #include <GL/gl.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 u_tex_loc_ = glGetUniformLocation(program_, "u_tex"); 350 u_tex_loc_ = glGetUniformLocation(program_, "u_tex");
351 u_mat_loc_ = glGetUniformLocation(program_, "u_matViewProjection"); 351 u_mat_loc_ = glGetUniformLocation(program_, "u_matViewProjection");
352 352
353 return true; 353 return true;
354 } 354 }
355 355
356 } // namespace 356 } // namespace
357 357
358 // static 358 // static
359 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { 359 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) {
360 gfx::GLSurface::InitializeOneOff(); 360 gfx::GLSurface::InitializeOneOff();
361 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) 361 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone)
362 return new glHidden::CompositorGL(widget); 362 return new glHidden::CompositorGL(widget);
363 return NULL; 363 return NULL;
364 } 364 }
365 #else 365 #else
366 class CompositorGL : public Compositor { 366 class CompositorGL : public Compositor {
367 public: 367 public:
368 explicit CompositorGL(gfx::AcceleratedWidget widget); 368 explicit CompositorGL(gfx::AcceleratedWidget widget);
369 369
370 private: 370 private:
371 // Overridden from Compositor. 371 // Overridden from Compositor.
372 void NotifyStart() OVERRIDE; 372 void NotifyStart() OVERRIDE;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 // static 424 // static
425 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { 425 Compositor* Compositor::Create(gfx::AcceleratedWidget widget) {
426 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) 426 if (gfx::GetGLImplementation() != gfx::kGLImplementationNone)
427 return new CompositorGL(widget); 427 return new CompositorGL(widget);
428 return NULL; 428 return NULL;
429 } 429 }
430 #endif 430 #endif
431 431
432 } // namespace ui 432 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/test/unit/chrome_test_suite.cc ('k') | views/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698