Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: ui/gl/gl_share_group.cc

Issue 12383042: Switch all contexts in a share group to be on the same screen as the window they present to. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_share_group.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_id_(-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
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::SetRendererID(int renderer_id) {
60 renderer_id_ = renderer_id;
61 }
62
63 int GLShareGroup::GetRendererID() {
64 return renderer_id_;
65 }
66 #endif
67
54 GLShareGroup::~GLShareGroup() { 68 GLShareGroup::~GLShareGroup() {
55 } 69 }
56 70
57 } // namespace gfx 71 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_share_group.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698