OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContextFactory.h" | 9 #include "GrContextFactory.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 SkAutoTUnref<SkGLContext> glCtx; | 37 SkAutoTUnref<SkGLContext> glCtx; |
38 SkAutoTUnref<GrContext> grCtx; | 38 SkAutoTUnref<GrContext> grCtx; |
39 switch (type) { | 39 switch (type) { |
40 case kNVPR_GLContextType: // fallthru | 40 case kNVPR_GLContextType: // fallthru |
41 case kNative_GLContextType: | 41 case kNative_GLContextType: |
42 glCtx.reset(SkCreatePlatformGLContext(forcedGpuAPI)); | 42 glCtx.reset(SkCreatePlatformGLContext(forcedGpuAPI)); |
43 break; | 43 break; |
44 #ifdef SK_ANGLE | 44 #ifdef SK_ANGLE |
45 case kANGLE_GLContextType: | 45 case kANGLE_GLContextType: |
46 glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI)); | 46 glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI, false)); |
| 47 break; |
| 48 case kANGLE_GL_GLContextType: |
| 49 glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI, true)); |
47 break; | 50 break; |
48 #endif | 51 #endif |
49 #ifdef SK_COMMAND_BUFFER | 52 #ifdef SK_COMMAND_BUFFER |
50 case kCommandBuffer_GLContextType: | 53 case kCommandBuffer_GLContextType: |
51 glCtx.reset(SkCommandBufferGLContext::Create(forcedGpuAPI)); | 54 glCtx.reset(SkCommandBufferGLContext::Create(forcedGpuAPI)); |
52 break; | 55 break; |
53 #endif | 56 #endif |
54 #ifdef SK_MESA | 57 #ifdef SK_MESA |
55 case kMESA_GLContextType: | 58 case kMESA_GLContextType: |
56 glCtx.reset(SkMesaGLContext::Create(forcedGpuAPI)); | 59 glCtx.reset(SkMesaGLContext::Create(forcedGpuAPI)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 115 } |
113 | 116 |
114 GPUContext& ctx = fContexts.push_back(); | 117 GPUContext& ctx = fContexts.push_back(); |
115 ctx.fGLContext = glCtx.get(); | 118 ctx.fGLContext = glCtx.get(); |
116 ctx.fGLContext->ref(); | 119 ctx.fGLContext->ref(); |
117 ctx.fGrContext = grCtx.get(); | 120 ctx.fGrContext = grCtx.get(); |
118 ctx.fGrContext->ref(); | 121 ctx.fGrContext->ref(); |
119 ctx.fType = type; | 122 ctx.fType = type; |
120 return ctx.fGrContext; | 123 return ctx.fGrContext; |
121 } | 124 } |
OLD | NEW |