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 "GLTestContext.h" | 8 #include "GLTestContext.h" |
9 #include "gl/GrGLUtil.h" | 9 #include "gl/GrGLUtil.h" |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 INHERITED::teardown(); | 54 INHERITED::teardown(); |
55 } | 55 } |
56 | 56 |
57 void GLTestContext::testAbandon() { | 57 void GLTestContext::testAbandon() { |
58 INHERITED::testAbandon(); | 58 INHERITED::testAbandon(); |
59 if (fGL) { | 59 if (fGL) { |
60 fGL->abandon(); | 60 fGL->abandon(); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
| 64 void GLTestContext::submit() { |
| 65 if (fGL) { |
| 66 GR_GL_CALL(fGL.get(), Flush()); |
| 67 } |
| 68 } |
| 69 |
| 70 void GLTestContext::finish() { |
| 71 if (fGL) { |
| 72 GR_GL_CALL(fGL.get(), Finish()); |
| 73 } |
| 74 } |
| 75 |
64 GLTestContext::GLFenceSync* GLTestContext::GLFenceSync::CreateIfSupported(const
GLTestContext* ctx) { | 76 GLTestContext::GLFenceSync* GLTestContext::GLFenceSync::CreateIfSupported(const
GLTestContext* ctx) { |
65 SkAutoTDelete<GLFenceSync> ret(new GLFenceSync); | 77 SkAutoTDelete<GLFenceSync> ret(new GLFenceSync); |
66 | 78 |
67 if (kGL_GrGLStandard == ctx->gl()->fStandard) { | 79 if (kGL_GrGLStandard == ctx->gl()->fStandard) { |
68 const GrGLubyte* versionStr; | 80 const GrGLubyte* versionStr; |
69 GR_GL_CALL_RET(ctx->gl(), versionStr, GetString(GR_GL_VERSION)); | 81 GR_GL_CALL_RET(ctx->gl(), versionStr, GetString(GR_GL_VERSION)); |
70 GrGLVersion version = GrGLGetVersionFromString(reinterpret_cast<const ch
ar*>(versionStr)); | 82 GrGLVersion version = GrGLGetVersionFromString(reinterpret_cast<const ch
ar*>(versionStr)); |
71 if (version < GR_GL_VER(3,2) && !ctx->gl()->hasExtension("GL_ARB_sync"))
{ | 83 if (version < GR_GL_VER(3,2) && !ctx->gl()->hasExtension("GL_ARB_sync"))
{ |
72 return nullptr; | 84 return nullptr; |
73 } | 85 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 GR_GL_NEAREST)); | 143 GR_GL_NEAREST)); |
132 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_S, | 144 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_S, |
133 GR_GL_CLAMP_TO_EDGE)); | 145 GR_GL_CLAMP_TO_EDGE)); |
134 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_T, | 146 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_T, |
135 GR_GL_CLAMP_TO_EDGE)); | 147 GR_GL_CLAMP_TO_EDGE)); |
136 GR_GL_CALL(fGL, TexImage2D(GR_GL_TEXTURE_RECTANGLE, 0, internalFormat, width
, height, 0, | 148 GR_GL_CALL(fGL, TexImage2D(GR_GL_TEXTURE_RECTANGLE, 0, internalFormat, width
, height, 0, |
137 externalFormat, externalType, data)); | 149 externalFormat, externalType, data)); |
138 return id; | 150 return id; |
139 } | 151 } |
140 } // namespace sk_gpu_test | 152 } // namespace sk_gpu_test |
OLD | NEW |