OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkOSWindow_Android.h" | 8 #include "SkOSWindow_Android.h" |
9 | 9 |
10 #include <GLES/gl.h> | 10 #include <GLES/gl.h> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 eglChooseConfig(display, configAttribs, &config, 1, &numConfigs); | 104 eglChooseConfig(display, configAttribs, &config, 1, &numConfigs); |
105 | 105 |
106 /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is | 106 /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is |
107 * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). | 107 * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). |
108 * As soon as we picked a EGLConfig, we can safely reconfigure the | 108 * As soon as we picked a EGLConfig, we can safely reconfigure the |
109 * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ | 109 * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ |
110 eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format); | 110 eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format); |
111 | 111 |
112 ANativeWindow_setBuffersGeometry(fNativeWindow, 0, 0, format); | 112 ANativeWindow_setBuffersGeometry(fNativeWindow, 0, 0, format); |
113 | 113 |
114 surface = eglCreateWindowSurface(display, config, fNativeWindow, NULL); | 114 surface = eglCreateWindowSurface(display, config, fNativeWindow, nullptr
); |
115 context = eglCreateContext(display, config, NULL, kAPIs[api].fContextAtt
ribs); | 115 context = eglCreateContext(display, config, nullptr, kAPIs[api].fContext
Attribs); |
116 if (EGL_NO_CONTEXT == context) { | 116 if (EGL_NO_CONTEXT == context) { |
117 SkDebugf("eglCreateContext failed. EGL Error: 0x%08x\n", eglGetErro
r()); | 117 SkDebugf("eglCreateContext failed. EGL Error: 0x%08x\n", eglGetErro
r()); |
118 continue; | 118 continue; |
119 } | 119 } |
120 | 120 |
121 if (!eglMakeCurrent(display, surface, surface, context)) { | 121 if (!eglMakeCurrent(display, surface, surface, context)) { |
122 SkDebugf("eglMakeCurrent failed. EGL Error: 0x%08x\n", eglGetError(
)); | 122 SkDebugf("eglMakeCurrent failed. EGL Error: 0x%08x\n", eglGetError(
)); |
123 continue; | 123 continue; |
124 } | 124 } |
125 | 125 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 /////////////////////////////////////////// | 179 /////////////////////////////////////////// |
180 /////////////// SkEvent impl ////////////// | 180 /////////////// SkEvent impl ////////////// |
181 /////////////////////////////////////////// | 181 /////////////////////////////////////////// |
182 | 182 |
183 void SkEvent::SignalQueueTimer(SkMSec ms) { | 183 void SkEvent::SignalQueueTimer(SkMSec ms) { |
184 } | 184 } |
185 | 185 |
186 void SkEvent::SignalNonEmptyQueue() { | 186 void SkEvent::SignalNonEmptyQueue() { |
187 } | 187 } |
OLD | NEW |