| 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() : shared_context_(NULL) { |
| 13 : shared_context_(NULL) | |
| 14 #if defined(OS_MACOSX) | |
| 15 , renderer_id_(-1) | |
| 16 #endif | |
| 17 { | |
| 18 } | 13 } |
| 19 | 14 |
| 20 void GLShareGroup::AddContext(GLContext* context) { | 15 void GLShareGroup::AddContext(GLContext* context) { |
| 21 contexts_.insert(context); | 16 contexts_.insert(context); |
| 22 } | 17 } |
| 23 | 18 |
| 24 void GLShareGroup::RemoveContext(GLContext* context) { | 19 void GLShareGroup::RemoveContext(GLContext* context) { |
| 25 contexts_.erase(context); | 20 contexts_.erase(context); |
| 26 if (shared_context_ == context) | 21 if (shared_context_ == context) |
| 27 shared_context_ = NULL; | 22 shared_context_ = NULL; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 48 | 43 |
| 49 void GLShareGroup::SetSharedContext(GLContext* context) { | 44 void GLShareGroup::SetSharedContext(GLContext* context) { |
| 50 DCHECK(contexts_.find(context) != contexts_.end()); | 45 DCHECK(contexts_.find(context) != contexts_.end()); |
| 51 shared_context_ = context; | 46 shared_context_ = context; |
| 52 } | 47 } |
| 53 | 48 |
| 54 GLContext* GLShareGroup::GetSharedContext() { | 49 GLContext* GLShareGroup::GetSharedContext() { |
| 55 return shared_context_; | 50 return shared_context_; |
| 56 } | 51 } |
| 57 | 52 |
| 58 #if defined(OS_MACOSX) | |
| 59 void GLShareGroup::SetRendererID(int renderer_id) { | |
| 60 renderer_id_ = renderer_id; | |
| 61 } | |
| 62 | |
| 63 int GLShareGroup::GetRendererID() { | |
| 64 return renderer_id_; | |
| 65 } | |
| 66 #endif | |
| 67 | |
| 68 GLShareGroup::~GLShareGroup() { | 53 GLShareGroup::~GLShareGroup() { |
| 69 } | 54 } |
| 70 | 55 |
| 71 } // namespace gfx | 56 } // namespace gfx |
| OLD | NEW |