| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkOSWindow_SDL.h" | 7 #include "SkOSWindow_SDL.h" |
| 8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 | 9 |
| 10 #if defined(SK_BUILD_FOR_ANDROID) | 10 #if defined(SK_BUILD_FOR_ANDROID) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return nullptr; | 50 return nullptr; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SkOSWindow::release() { | 53 void SkOSWindow::release() { |
| 54 if (fGLContext) { | 54 if (fGLContext) { |
| 55 SDL_GL_DeleteContext(fGLContext); | 55 SDL_GL_DeleteContext(fGLContext); |
| 56 fGLContext = nullptr; | 56 fGLContext = nullptr; |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, Attachme
ntInfo* info) { | 60 bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount, bool dee
pColor, |
| 61 AttachmentInfo* info) { |
| 61 this->createWindow(msaaSampleCount); | 62 this->createWindow(msaaSampleCount); |
| 62 if (!fWindow) { | 63 if (!fWindow) { |
| 63 return false; | 64 return false; |
| 64 } | 65 } |
| 65 if (!fGLContext) { | 66 if (!fGLContext) { |
| 66 fGLContext = SDL_GL_CreateContext(fWindow); | 67 fGLContext = SDL_GL_CreateContext(fWindow); |
| 67 if (!fGLContext) { | 68 if (!fGLContext) { |
| 68 report_sdl_error("Failed to create SDL GL context."); | 69 report_sdl_error("Failed to create SDL GL context."); |
| 69 return false; | 70 return false; |
| 70 } | 71 } |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 392 |
| 392 SkOSWindow::RunEventLoop(); | 393 SkOSWindow::RunEventLoop(); |
| 393 | 394 |
| 394 delete window; | 395 delete window; |
| 395 application_term(); | 396 application_term(); |
| 396 | 397 |
| 397 SDL_Quit(); | 398 SDL_Quit(); |
| 398 | 399 |
| 399 return 0; | 400 return 0; |
| 400 } | 401 } |
| OLD | NEW |