| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "gl/SkGLContext.h" | 8 #include "gl/SkGLContext.h" |
| 9 | 9 |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 static bool ctxErrorOccurred = false; | 41 static bool ctxErrorOccurred = false; |
| 42 static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) { | 42 static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) { |
| 43 ctxErrorOccurred = true; | 43 ctxErrorOccurred = true; |
| 44 return 0; | 44 return 0; |
| 45 } | 45 } |
| 46 | 46 |
| 47 class GLXGLContext : public SkGLContext { | 47 class GLXGLContext : public SkGLContext { |
| 48 public: | 48 public: |
| 49 GLXGLContext(GrGLStandard forcedGpuAPI); | 49 GLXGLContext(GrGLStandard forcedGpuAPI); |
| 50 virtual ~GLXGLContext() SK_OVERRIDE; | 50 ~GLXGLContext() SK_OVERRIDE; |
| 51 virtual void makeCurrent() const SK_OVERRIDE; | 51 void makeCurrent() const SK_OVERRIDE; |
| 52 virtual void swapBuffers() const SK_OVERRIDE; | 52 void swapBuffers() const SK_OVERRIDE; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 void destroyGLContext(); | 55 void destroyGLContext(); |
| 56 | 56 |
| 57 GLXContext fContext; | 57 GLXContext fContext; |
| 58 Display* fDisplay; | 58 Display* fDisplay; |
| 59 Pixmap fPixmap; | 59 Pixmap fPixmap; |
| 60 GLXPixmap fGlxPixmap; | 60 GLXPixmap fGlxPixmap; |
| 61 }; | 61 }; |
| 62 | 62 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } // anonymous namespace | 324 } // anonymous namespace |
| 325 | 325 |
| 326 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { | 326 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { |
| 327 GLXGLContext* ctx = SkNEW_ARGS(GLXGLContext, (forcedGpuAPI)); | 327 GLXGLContext* ctx = SkNEW_ARGS(GLXGLContext, (forcedGpuAPI)); |
| 328 if (!ctx->isValid()) { | 328 if (!ctx->isValid()) { |
| 329 SkDELETE(ctx); | 329 SkDELETE(ctx); |
| 330 return NULL; | 330 return NULL; |
| 331 } | 331 } |
| 332 return ctx; | 332 return ctx; |
| 333 } | 333 } |
| OLD | NEW |