OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLContext.h" | 8 #include "GrGLContext.h" |
9 | 9 |
10 //////////////////////////////////////////////////////////////////////////////// | 10 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 fInterface = NULL; | 66 fInterface = NULL; |
67 this->initialize(interface); | 67 this->initialize(interface); |
68 } | 68 } |
69 | 69 |
70 GrGLContext::GrGLContext(const GrGLContext& ctx) { | 70 GrGLContext::GrGLContext(const GrGLContext& ctx) { |
71 fInterface = NULL; | 71 fInterface = NULL; |
72 *this = ctx; | 72 *this = ctx; |
73 } | 73 } |
74 | 74 |
75 GrGLContext& GrGLContext::operator = (const GrGLContext& ctx) { | 75 GrGLContext& GrGLContext::operator = (const GrGLContext& ctx) { |
76 GrSafeAssign(fInterface, ctx.fInterface); | 76 SkRefCnt_SafeAssign(fInterface, ctx.fInterface); |
77 fInfo = ctx.fInfo; | 77 fInfo = ctx.fInfo; |
78 return *this; | 78 return *this; |
79 } | 79 } |
80 | 80 |
81 void GrGLContext::reset() { | 81 void GrGLContext::reset() { |
82 GrSafeSetNull(fInterface); | 82 SkSafeSetNull(fInterface); |
83 fInfo.reset(); | 83 fInfo.reset(); |
84 } | 84 } |
85 | 85 |
86 bool GrGLContext::initialize(const GrGLInterface* interface) { | 86 bool GrGLContext::initialize(const GrGLInterface* interface) { |
87 if (fInfo.initialize(interface)) { | 87 if (fInfo.initialize(interface)) { |
88 fInterface = interface; | 88 fInterface = interface; |
89 interface->ref(); | 89 interface->ref(); |
90 return true; | 90 return true; |
91 } | 91 } |
92 return false; | 92 return false; |
93 } | 93 } |
OLD | NEW |