diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-09 18:25:38 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-09 18:25:38 +0000 |
commit | c9542ca3d00878a18a57af80037060d6374d5650 (patch) | |
tree | dffaa6a224392fa3806f18336ac54d3ee6a23ea5 /src/gpu/gl | |
parent | 338a49fc55be8555e171419d079a1b6317060a38 (diff) |
Add swapBuffer call to SkGLContextHelper.
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/26701002
git-svn-id: http://skia.googlecode.com/svn/trunk@11682 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/android/SkNativeGLContext_android.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/angle/SkANGLEGLContext.cpp | 6 | ||||
-rw-r--r-- | src/gpu/gl/iOS/SkNativeGLContext_iOS.mm | 2 | ||||
-rw-r--r-- | src/gpu/gl/mac/SkNativeGLContext_mac.cpp | 5 | ||||
-rw-r--r-- | src/gpu/gl/mesa/SkMesaGLContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp | 3 | ||||
-rw-r--r-- | src/gpu/gl/unix/SkNativeGLContext_unix.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/win/SkNativeGLContext_win.cpp | 6 |
8 files changed, 34 insertions, 0 deletions
diff --git a/src/gpu/gl/android/SkNativeGLContext_android.cpp b/src/gpu/gl/android/SkNativeGLContext_android.cpp index 8811ddae9d..dda7d9d3fa 100644 --- a/src/gpu/gl/android/SkNativeGLContext_android.cpp +++ b/src/gpu/gl/android/SkNativeGLContext_android.cpp @@ -165,3 +165,9 @@ void SkNativeGLContext::makeCurrent() const { SkDebugf("Could not set the context.\n"); } } + +void SkNativeGLContext::swapBuffers() const { + if (!eglSwapBuffers(fDisplay, fSurface)) { + SkDebugf("Could not complete eglSwapBuffers.\n"); + } +} diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp index fea27622a0..2600ec4634 100644 --- a/src/gpu/gl/angle/SkANGLEGLContext.cpp +++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp @@ -105,3 +105,9 @@ void SkANGLEGLContext::makeCurrent() const { SkDebugf("Could not set the context.\n"); } } + +void SkANGLEGLContext::swapBuffers() const { + if (!eglSwapBuffers(fDisplay, fSurface)) { + SkDebugf("Could not complete eglSwapBuffers.\n"); + } +} diff --git a/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm b/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm index 46bd03a2c3..a276fd05da 100644 --- a/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm +++ b/src/gpu/gl/iOS/SkNativeGLContext_iOS.mm @@ -60,3 +60,5 @@ void SkNativeGLContext::makeCurrent() const { SkDebugf("Could not set the context.\n"); } } + +void SkNativeGLContext::swapBuffers() const { }
\ No newline at end of file diff --git a/src/gpu/gl/mac/SkNativeGLContext_mac.cpp b/src/gpu/gl/mac/SkNativeGLContext_mac.cpp index 2c43c3d2d4..df316d7ed1 100644 --- a/src/gpu/gl/mac/SkNativeGLContext_mac.cpp +++ b/src/gpu/gl/mac/SkNativeGLContext_mac.cpp @@ -39,6 +39,7 @@ const GrGLInterface* SkNativeGLContext::createGLContext() { #if MAC_OS_X_VERSION_10_7 kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, #endif + kCGLPFADoubleBuffer, (CGLPixelFormatAttribute)0 }; CGLPixelFormatObj pixFormat; @@ -74,3 +75,7 @@ const GrGLInterface* SkNativeGLContext::createGLContext() { void SkNativeGLContext::makeCurrent() const { CGLSetCurrentContext(fContext); } + +void SkNativeGLContext::swapBuffers() const { + CGLFlushDrawable(fContext); +} diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp index 2be0c13036..0199d12c19 100644 --- a/src/gpu/gl/mesa/SkMesaGLContext.cpp +++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp @@ -104,3 +104,5 @@ void SkMesaGLContext::makeCurrent() const { } } } + +void SkMesaGLContext::swapBuffers() const { } diff --git a/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp b/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp index 59ed2bf86a..69a74caf8a 100644 --- a/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp +++ b/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp @@ -32,3 +32,6 @@ const GrGLInterface* SkNativeGLContext::createGLContext() { void SkNativeGLContext::makeCurrent() const { } + +void SkNativeGLContext::swapBuffers() const { +} diff --git a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp b/src/gpu/gl/unix/SkNativeGLContext_unix.cpp index e6fae8ed7b..c4bd6f937d 100644 --- a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp +++ b/src/gpu/gl/unix/SkNativeGLContext_unix.cpp @@ -285,3 +285,7 @@ void SkNativeGLContext::makeCurrent() const { SkDebugf("Could not set the context.\n"); } } + +void SkNativeGLContext::swapBuffers() const { + glXSwapBuffers(fDisplay, fGlxPixmap); +} diff --git a/src/gpu/gl/win/SkNativeGLContext_win.cpp b/src/gpu/gl/win/SkNativeGLContext_win.cpp index 4c736994fe..d8777274bc 100644 --- a/src/gpu/gl/win/SkNativeGLContext_win.cpp +++ b/src/gpu/gl/win/SkNativeGLContext_win.cpp @@ -112,3 +112,9 @@ void SkNativeGLContext::makeCurrent() const { SkDebugf("Could not create rendering context.\n"); } } + +void SkNativeGLContext::swapBuffers() const { + if (!SwapBuffers(fDeviceContext)) { + SkDebugf("Could not complete SwapBuffers.\n"); + } +} |