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

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

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment addressed Created 4 years, 10 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
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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/gl/gl_context.h" 9 #include "ui/gl/gl_context.h"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 void* GLShareGroup::GetHandle() { 31 void* GLShareGroup::GetHandle() {
32 GLContext* context = GetContext(); 32 GLContext* context = GetContext();
33 if (context) 33 if (context)
34 return context->GetHandle(); 34 return context->GetHandle();
35 35
36 return NULL; 36 return NULL;
37 } 37 }
38 38
39 GLContext* GLShareGroup::GetContext() { 39 GLContext* GLShareGroup::GetContext() {
40 for (ContextSet::iterator it = contexts_.begin(); 40 for (auto context : contexts_) {
41 it != contexts_.end(); 41 if (context->GetHandle())
42 ++it) { 42 return context;
43 if ((*it)->GetHandle())
44 return *it;
45 } 43 }
46 44
47 return NULL; 45 return NULL;
48 } 46 }
49 47
50 void GLShareGroup::SetSharedContext(GLContext* context) { 48 void GLShareGroup::SetSharedContext(GLContext* context) {
51 DCHECK(contexts_.find(context) != contexts_.end()); 49 DCHECK(contexts_.find(context) != contexts_.end());
52 shared_context_ = context; 50 shared_context_ = context;
53 } 51 }
54 52
55 GLContext* GLShareGroup::GetSharedContext() { 53 GLContext* GLShareGroup::GetSharedContext() {
56 return shared_context_; 54 return shared_context_;
57 } 55 }
58 56
59 #if defined(OS_MACOSX) 57 #if defined(OS_MACOSX)
60 void GLShareGroup::SetRendererID(int renderer_id) { 58 void GLShareGroup::SetRendererID(int renderer_id) {
61 renderer_id_ = renderer_id; 59 renderer_id_ = renderer_id;
62 } 60 }
63 61
64 int GLShareGroup::GetRendererID() { 62 int GLShareGroup::GetRendererID() {
65 return renderer_id_; 63 return renderer_id_;
66 } 64 }
67 #endif 65 #endif
68 66
69 GLShareGroup::~GLShareGroup() { 67 GLShareGroup::~GLShareGroup() {
70 } 68 }
71 69
72 } // namespace gfx 70 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698