OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "Window.h" | 8 #include "Window.h" |
9 | 9 |
10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (backbuffer) { | 68 if (backbuffer) { |
69 // draw into the canvas of this surface | 69 // draw into the canvas of this surface |
70 SkCanvas* canvas = backbuffer->getCanvas(); | 70 SkCanvas* canvas = backbuffer->getCanvas(); |
71 | 71 |
72 fPaintFunc(canvas, fPaintUserData); | 72 fPaintFunc(canvas, fPaintUserData); |
73 | 73 |
74 canvas->flush(); | 74 canvas->flush(); |
75 | 75 |
76 fWindowContext->swapBuffers(); | 76 fWindowContext->swapBuffers(); |
77 } else { | 77 } else { |
| 78 printf("no backbuffer!?\n"); |
78 // try recreating testcontext | 79 // try recreating testcontext |
79 } | 80 } |
80 } | 81 } |
81 | 82 |
82 void Window::onResize(uint32_t w, uint32_t h) { | 83 void Window::onResize(uint32_t w, uint32_t h) { |
83 fWidth = w; | 84 fWidth = w; |
84 fHeight = h; | 85 fHeight = h; |
85 fWindowContext->resize(w, h); | 86 fWindowContext->resize(w, h); |
86 } | 87 } |
87 | 88 |
(...skipping 10 matching lines...) Expand all Loading... |
98 fIsContentInvalidated = true; | 99 fIsContentInvalidated = true; |
99 onInval(); | 100 onInval(); |
100 } | 101 } |
101 } | 102 } |
102 | 103 |
103 void Window::markInvalProcessed() { | 104 void Window::markInvalProcessed() { |
104 fIsContentInvalidated = false; | 105 fIsContentInvalidated = false; |
105 } | 106 } |
106 | 107 |
107 } // namespace sk_app | 108 } // namespace sk_app |
OLD | NEW |