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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 SkBudgeted::kNo)
); | 345 SkBudgeted::kNo)
); |
346 | 346 |
347 SkCanvas* gpuCanvas = fGpuSurface->getCanvas(); | 347 SkCanvas* gpuCanvas = fGpuSurface->getCanvas(); |
348 | 348 |
349 // With ten-bit output, we need to manually apply the gamma of the o
utput device | 349 // With ten-bit output, we need to manually apply the gamma of the o
utput device |
350 // (unless we're in non-gamma correct mode, in which case our data i
s already | 350 // (unless we're in non-gamma correct mode, in which case our data i
s already |
351 // fake-sRGB, like we're expected to put in the 10-bit buffer): | 351 // fake-sRGB, like we're expected to put in the 10-bit buffer): |
352 bool doGamma = (fActualColorBits == 30) && SkImageInfoIsGammaCorrect
(win->info()); | 352 bool doGamma = (fActualColorBits == 30) && SkImageInfoIsGammaCorrect
(win->info()); |
353 | 353 |
354 SkPaint gammaPaint; | 354 SkPaint gammaPaint; |
355 gammaPaint.setXfermodeMode(SkXfermode::kSrc_Mode); | 355 gammaPaint.setBlendMode(SkBlendMode::kSrc); |
356 if (doGamma) { | 356 if (doGamma) { |
357 gammaPaint.setColorFilter(SkGammaColorFilter::Make(1.0f / 2.2f))
; | 357 gammaPaint.setColorFilter(SkGammaColorFilter::Make(1.0f / 2.2f))
; |
358 } | 358 } |
359 | 359 |
360 gpuCanvas->drawImage(image, 0, 0, &gammaPaint); | 360 gpuCanvas->drawImage(image, 0, 0, &gammaPaint); |
361 } | 361 } |
362 | 362 |
363 fGpuSurface->prepareForExternalIO(); | 363 fGpuSurface->prepareForExternalIO(); |
364 #endif | 364 #endif |
365 | 365 |
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2392 #ifdef SK_BUILD_FOR_MAC | 2392 #ifdef SK_BUILD_FOR_MAC |
2393 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2393 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2394 #endif | 2394 #endif |
2395 SkGraphics::Init(); | 2395 SkGraphics::Init(); |
2396 SkEvent::Init(); | 2396 SkEvent::Init(); |
2397 } | 2397 } |
2398 | 2398 |
2399 void application_term() { | 2399 void application_term() { |
2400 SkEvent::Term(); | 2400 SkEvent::Term(); |
2401 } | 2401 } |
OLD | NEW |