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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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"); | 86 printf("no backbuffer!?\n"); |
87 // try recreating testcontext | 87 // try recreating testcontext |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 void Window::onResize(uint32_t w, uint32_t h) { | 91 void Window::onResize(int w, int h) { |
92 fWidth = w; | 92 fWidth = w; |
93 fHeight = h; | 93 fHeight = h; |
94 fWindowContext->resize(w, h); | 94 fWindowContext->resize(w, h); |
95 } | 95 } |
96 | 96 |
97 const DisplayParams& Window::getDisplayParams() { | 97 const DisplayParams& Window::getDisplayParams() { |
98 return fWindowContext->getDisplayParams(); | 98 return fWindowContext->getDisplayParams(); |
99 } | 99 } |
100 | 100 |
101 void Window::setDisplayParams(const DisplayParams& params) { | 101 void Window::setDisplayParams(const DisplayParams& params) { |
102 fWindowContext->setDisplayParams(params); | 102 fWindowContext->setDisplayParams(params); |
103 } | 103 } |
104 | 104 |
105 void Window::inval() { | 105 void Window::inval() { |
106 if (!fIsContentInvalidated) { | 106 if (!fIsContentInvalidated) { |
107 fIsContentInvalidated = true; | 107 fIsContentInvalidated = true; |
108 onInval(); | 108 onInval(); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 void Window::markInvalProcessed() { | 112 void Window::markInvalProcessed() { |
113 fIsContentInvalidated = false; | 113 fIsContentInvalidated = false; |
114 } | 114 } |
115 | 115 |
116 sk_sp<SkSurface> Window::getOffscreenSurface(bool forceSRGB) { | 116 sk_sp<SkSurface> Window::getOffscreenSurface(bool forceSRGB) { |
117 return fWindowContext->createOffscreenSurface(forceSRGB); | 117 return fWindowContext->createOffscreenSurface(forceSRGB); |
118 } | 118 } |
119 | 119 |
120 } // namespace sk_app | 120 } // namespace sk_app |
OLD | NEW |