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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (backbuffer) { | 76 if (backbuffer) { |
77 // draw into the canvas of this surface | 77 // draw into the canvas of this surface |
78 SkCanvas* canvas = backbuffer->getCanvas(); | 78 SkCanvas* canvas = backbuffer->getCanvas(); |
79 | 79 |
80 fPaintFunc(canvas, fPaintUserData); | 80 fPaintFunc(canvas, fPaintUserData); |
81 | 81 |
82 canvas->flush(); | 82 canvas->flush(); |
83 | 83 |
84 fWindowContext->swapBuffers(); | 84 fWindowContext->swapBuffers(); |
85 } else { | 85 } else { |
86 printf("no backbuffer!?\n"); | |
87 // try recreating testcontext | 86 // try recreating testcontext |
88 } | 87 } |
89 } | 88 } |
90 | 89 |
91 void Window::onResize(uint32_t w, uint32_t h) { | 90 void Window::onResize(uint32_t w, uint32_t h) { |
92 fWidth = w; | 91 fWidth = w; |
93 fHeight = h; | 92 fHeight = h; |
94 fWindowContext->resize(w, h); | 93 fWindowContext->resize(w, h); |
95 } | 94 } |
96 | 95 |
(...skipping 10 matching lines...) Expand all Loading... |
107 fIsContentInvalidated = true; | 106 fIsContentInvalidated = true; |
108 onInval(); | 107 onInval(); |
109 } | 108 } |
110 } | 109 } |
111 | 110 |
112 void Window::markInvalProcessed() { | 111 void Window::markInvalProcessed() { |
113 fIsContentInvalidated = false; | 112 fIsContentInvalidated = false; |
114 } | 113 } |
115 | 114 |
116 } // namespace sk_app | 115 } // namespace sk_app |
OLD | NEW |