OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |