blob: 868b1b29f21ba2b6f10a450101958ee5cba84421 [file] [log] [blame]
[email protected]24edbd02011-04-14 00:11:591// 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]c777de52011-09-09 23:08:567#include "base/threading/thread_local.h"
[email protected]43390252011-07-28 12:54:208#include "ui/gfx/gl/gl_context.h"
9
[email protected]24edbd02011-04-14 00:11:5910namespace gfx {
11
[email protected]c777de52011-09-09 23:08:5612static base::ThreadLocalPointer<GLSurface> current_surface_;
13
[email protected]ffae4022011-05-12 22:54:2914GLSurface::GLSurface() {
15}
16
17GLSurface::~GLSurface() {
[email protected]c777de52011-09-09 23:08:5618 if (GetCurrent() == this)
19 SetCurrent(NULL);
[email protected]ffae4022011-05-12 22:54:2920}
21
[email protected]7b1a3da22011-04-27 23:56:3322bool GLSurface::Initialize()
23{
24 return true;
25}
26
[email protected]24edbd02011-04-14 00:11:5927unsigned int GLSurface::GetBackingFrameBufferObject() {
28 return 0;
29}
30
[email protected]e4f9f9b2011-10-17 13:22:0131bool GLSurface::OnMakeCurrent(GLContext* context) {
32 return true;
[email protected]2e7bbf22011-07-22 18:41:2933}
34
[email protected]8cc980c52011-10-14 20:35:5135void GLSurface::SetVisible(bool visible) {
36}
37
[email protected]c777de52011-09-09 23:08:5638GLSurface* GLSurface::GetCurrent() {
39 return current_surface_.Get();
40}
41
42void GLSurface::SetCurrent(GLSurface* surface) {
43 current_surface_.Set(surface);
44}
45
[email protected]24edbd02011-04-14 00:11:5946} // namespace gfx