[email protected] | 24edbd0 | 2011-04-14 00:11:59 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "ui/gfx/gl/gl_surface.h" | ||||
6 | |||||
[email protected] | c777de5 | 2011-09-09 23:08:56 | [diff] [blame] | 7 | #include "base/threading/thread_local.h" |
[email protected] | 4339025 | 2011-07-28 12:54:20 | [diff] [blame] | 8 | #include "ui/gfx/gl/gl_context.h" |
9 | |||||
[email protected] | 24edbd0 | 2011-04-14 00:11:59 | [diff] [blame] | 10 | namespace gfx { |
11 | |||||
[email protected] | c777de5 | 2011-09-09 23:08:56 | [diff] [blame] | 12 | static base::ThreadLocalPointer<GLSurface> current_surface_; |
13 | |||||
[email protected] | ffae402 | 2011-05-12 22:54:29 | [diff] [blame] | 14 | GLSurface::GLSurface() { |
15 | } | ||||
16 | |||||
17 | GLSurface::~GLSurface() { | ||||
[email protected] | c777de5 | 2011-09-09 23:08:56 | [diff] [blame] | 18 | if (GetCurrent() == this) |
19 | SetCurrent(NULL); | ||||
[email protected] | ffae402 | 2011-05-12 22:54:29 | [diff] [blame] | 20 | } |
21 | |||||
[email protected] | 7b1a3da2 | 2011-04-27 23:56:33 | [diff] [blame] | 22 | bool GLSurface::Initialize() |
23 | { | ||||
24 | return true; | ||||
25 | } | ||||
26 | |||||
[email protected] | 24edbd0 | 2011-04-14 00:11:59 | [diff] [blame] | 27 | unsigned int GLSurface::GetBackingFrameBufferObject() { |
28 | return 0; | ||||
29 | } | ||||
30 | |||||
[email protected] | e4f9f9b | 2011-10-17 13:22:01 | [diff] [blame^] | 31 | bool GLSurface::OnMakeCurrent(GLContext* context) { |
32 | return true; | ||||
[email protected] | 2e7bbf2 | 2011-07-22 18:41:29 | [diff] [blame] | 33 | } |
34 | |||||
[email protected] | 8cc980c5 | 2011-10-14 20:35:51 | [diff] [blame] | 35 | void GLSurface::SetVisible(bool visible) { |
36 | } | ||||
37 | |||||
[email protected] | c777de5 | 2011-09-09 23:08:56 | [diff] [blame] | 38 | GLSurface* GLSurface::GetCurrent() { |
39 | return current_surface_.Get(); | ||||
40 | } | ||||
41 | |||||
42 | void GLSurface::SetCurrent(GLSurface* surface) { | ||||
43 | current_surface_.Set(surface); | ||||
44 | } | ||||
45 | |||||
[email protected] | 24edbd0 | 2011-04-14 00:11:59 | [diff] [blame] | 46 | } // namespace gfx |