| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GLFW/glfw3.h" | 8 #include "GLFW/glfw3.h" |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 GrBackendRenderTargetDesc desc; | 36 GrBackendRenderTargetDesc desc; |
| 37 desc.fWidth = w; | 37 desc.fWidth = w; |
| 38 desc.fHeight = h; | 38 desc.fHeight = h; |
| 39 desc.fConfig = kSkia8888_GrPixelConfig; | 39 desc.fConfig = kSkia8888_GrPixelConfig; |
| 40 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 40 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
| 41 desc.fSampleCnt = 1; | 41 desc.fSampleCnt = 1; |
| 42 desc.fStencilBits = 0; | 42 desc.fStencilBits = 0; |
| 43 desc.fRenderTargetHandle = 0; // assume default framebuffer | 43 desc.fRenderTargetHandle = 0; // assume default framebuffer |
| 44 | 44 |
| 45 sSurface = SkSurface::MakeFromBackendRenderTarget(sContext, desc, nullptr, n
ullptr).release(); | 45 sSurface = SkSurface::NewFromBackendRenderTarget(sContext, desc, NULL); |
| 46 } | 46 } |
| 47 | 47 |
| 48 static void cleanup_skia() { | 48 static void cleanup_skia() { |
| 49 delete sSurface; | 49 delete sSurface; |
| 50 delete sContext; | 50 delete sContext; |
| 51 } | 51 } |
| 52 | 52 |
| 53 const int kGrid = 100; | 53 const int kGrid = 100; |
| 54 const int kWidth = 960; | 54 const int kWidth = 960; |
| 55 const int kHeight = 640; | 55 const int kHeight = 640; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 glfwSwapBuffers(window); | 171 glfwSwapBuffers(window); |
| 172 } | 172 } |
| 173 | 173 |
| 174 cleanup_skia(); | 174 cleanup_skia(); |
| 175 | 175 |
| 176 glfwDestroyWindow(window); | 176 glfwDestroyWindow(window); |
| 177 glfwTerminate(); | 177 glfwTerminate(); |
| 178 exit(EXIT_SUCCESS); | 178 exit(EXIT_SUCCESS); |
| 179 } | 179 } |
| OLD | NEW |