Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: samplecode/SampleApp.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « samplecode/SampleAll.cpp ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698