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 | 7 |
8 #include "SampleApp.h" | 8 #include "SampleApp.h" |
9 | 9 |
10 #include "OverView.h" | 10 #include "OverView.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 SkSurfaceProps props(win->getSurfaceProps()); | 290 SkSurfaceProps props(win->getSurfaceProps()); |
291 if (kRGBA_F16_SkColorType == win->info().colorType() || fActualColor
Bits > 24) { | 291 if (kRGBA_F16_SkColorType == win->info().colorType() || fActualColor
Bits > 24) { |
292 // If we're rendering to F16, we need an off-screen surface - th
e current render | 292 // If we're rendering to F16, we need an off-screen surface - th
e current render |
293 // target is most likely the wrong format. | 293 // target is most likely the wrong format. |
294 // | 294 // |
295 // If we're using a deep (10-bit or higher) surface, we probably
need an off-screen | 295 // If we're using a deep (10-bit or higher) surface, we probably
need an off-screen |
296 // surface. 10-bit, in particular, has strange gamma behavior. | 296 // surface. 10-bit, in particular, has strange gamma behavior. |
297 return SkSurface::MakeRenderTarget(fCurContext, SkBudgeted::kNo,
win->info(), | 297 return SkSurface::MakeRenderTarget(fCurContext, SkBudgeted::kNo,
win->info(), |
298 fMSAASampleCount, &props).rel
ease(); | 298 fMSAASampleCount, &props).rel
ease(); |
299 } else { | 299 } else { |
300 return SkSurface::MakeRenderTargetDirect(fCurRenderTarget, &prop
s).release(); | 300 return SkSurface::MakeRenderTargetDirect(fCurRenderTarget, |
| 301 sk_ref_sp(win->info().c
olorSpace()), |
| 302 &props).release(); |
301 } | 303 } |
302 } | 304 } |
303 #endif | 305 #endif |
304 return nullptr; | 306 return nullptr; |
305 } | 307 } |
306 | 308 |
307 void publishCanvas(SampleWindow::DeviceType dType, | 309 void publishCanvas(SampleWindow::DeviceType dType, |
308 SkCanvas* canvas, SampleWindow* win) override { | 310 SkCanvas* canvas, SampleWindow* win) override { |
309 #if SK_SUPPORT_GPU | 311 #if SK_SUPPORT_GPU |
310 if (fCurContext) { | 312 if (fCurContext) { |
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 #ifdef SK_BUILD_FOR_MAC | 2253 #ifdef SK_BUILD_FOR_MAC |
2252 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2254 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2253 #endif | 2255 #endif |
2254 SkGraphics::Init(); | 2256 SkGraphics::Init(); |
2255 SkEvent::Init(); | 2257 SkEvent::Init(); |
2256 } | 2258 } |
2257 | 2259 |
2258 void application_term() { | 2260 void application_term() { |
2259 SkEvent::Term(); | 2261 SkEvent::Term(); |
2260 } | 2262 } |
OLD | NEW |