| OLD | NEW |
| 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 "ui/gl/gl_share_group.h" | 5 #include "ui/gl/gl_share_group.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/gl/gl_context.h" | 8 #include "ui/gl/gl_context.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 | 11 |
| 12 GLShareGroup::GLShareGroup() | 12 GLShareGroup::GLShareGroup() |
| 13 : shared_context_(NULL) { | 13 : shared_context_(NULL) |
| 14 #if defined(OS_MACOSX) |
| 15 , renderer_(-1) |
| 16 #endif |
| 17 { |
| 14 } | 18 } |
| 15 | 19 |
| 16 void GLShareGroup::AddContext(GLContext* context) { | 20 void GLShareGroup::AddContext(GLContext* context) { |
| 17 contexts_.insert(context); | 21 contexts_.insert(context); |
| 18 } | 22 } |
| 19 | 23 |
| 20 void GLShareGroup::RemoveContext(GLContext* context) { | 24 void GLShareGroup::RemoveContext(GLContext* context) { |
| 21 contexts_.erase(context); | 25 contexts_.erase(context); |
| 22 if (shared_context_ == context) | 26 if (shared_context_ == context) |
| 23 shared_context_ = NULL; | 27 shared_context_ = NULL; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 48 |
| 45 void GLShareGroup::SetSharedContext(GLContext* context) { | 49 void GLShareGroup::SetSharedContext(GLContext* context) { |
| 46 DCHECK(contexts_.find(context) != contexts_.end()); | 50 DCHECK(contexts_.find(context) != contexts_.end()); |
| 47 shared_context_ = context; | 51 shared_context_ = context; |
| 48 } | 52 } |
| 49 | 53 |
| 50 GLContext* GLShareGroup::GetSharedContext() { | 54 GLContext* GLShareGroup::GetSharedContext() { |
| 51 return shared_context_; | 55 return shared_context_; |
| 52 } | 56 } |
| 53 | 57 |
| 58 #if defined(OS_MACOSX) |
| 59 void GLShareGroup::SetRenderer(int renderer) { |
| 60 renderer_ = renderer; |
| 61 } |
| 62 |
| 63 int GLShareGroup::GetRenderer() { |
| 64 return renderer_; |
| 65 } |
| 66 #endif |
| 67 |
| 54 GLShareGroup::~GLShareGroup() { | 68 GLShareGroup::~GLShareGroup() { |
| 55 } | 69 } |
| 56 | 70 |
| 57 } // namespace gfx | 71 } // namespace gfx |
| OLD | NEW |