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

Unified Diff: src/gpu/gl/mesa/SkMesaGLContext.cpp

Issue 1194783003: Implement SkGLContext swapBuffers with fence syncs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows build Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/mesa/SkMesaGLContext.h ('k') | src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/mesa/SkMesaGLContext.cpp
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp
index 1fac5fadd663fde5bcbd900a4060d59c9d554458..701cc0d320c8433ffecd83044b1ed266d7560054 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp
@@ -50,26 +50,28 @@ SkMesaGLContext::SkMesaGLContext()
return;
}
- fGL.reset(GrGLCreateMesaInterface());
- if (NULL == fGL.get()) {
+ SkAutoTUnref<const GrGLInterface> gl(GrGLCreateMesaInterface());
+ if (NULL == gl.get()) {
SkDebugf("Could not create GL interface!\n");
this->destroyGLContext();
return;
}
- if (!fGL->validate()) {
+ if (!gl->validate()) {
SkDebugf("Could not validate GL interface!\n");
this->destroyGLContext();
return;
}
+
+ this->init(gl.detach());
}
SkMesaGLContext::~SkMesaGLContext() {
+ this->teardown();
this->destroyGLContext();
}
void SkMesaGLContext::destroyGLContext() {
- fGL.reset(NULL);
if (fImage) {
sk_free(fImage);
fImage = NULL;
@@ -83,7 +85,7 @@ void SkMesaGLContext::destroyGLContext() {
-void SkMesaGLContext::makeCurrent() const {
+void SkMesaGLContext::onPlatformMakeCurrent() const {
if (fContext) {
if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage,
GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) {
@@ -92,4 +94,8 @@ void SkMesaGLContext::makeCurrent() const {
}
}
-void SkMesaGLContext::swapBuffers() const { }
+void SkMesaGLContext::onPlatformSwapBuffers() const { }
+
+GrGLFuncPtr SkMesaGLContext::onPlatformGetProcAddress(const char* procName) const {
+ return OSMesaGetProcAddress(procName);
+}
« no previous file with comments | « src/gpu/gl/mesa/SkMesaGLContext.h ('k') | src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698