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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 2060823003: Implement fast, correct gamma conversion for color xforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Win test Created 4 years, 6 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 | « bench/ColorCodecBench.cpp ('k') | src/core/SkColorSpaceXform.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr cSpace, dstSpace); 894 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(sr cSpace, dstSpace);
895 if (!xform) { 895 if (!xform) {
896 // FIXME (msarett): 896 // FIXME (msarett):
897 // I haven't implemented conversions for all of the images that I've uploaded for 897 // I haven't implemented conversions for all of the images that I've uploaded for
898 // testing. Once we support all of them, this should be a fatal error. 898 // testing. Once we support all of them, this should be a fatal error.
899 return Error::Nonfatal("Unimplemented color conversion."); 899 return Error::Nonfatal("Unimplemented color conversion.");
900 } 900 }
901 901
902 uint32_t* row = (uint32_t*) bitmap.getPixels(); 902 uint32_t* row = (uint32_t*) bitmap.getPixels();
903 for (int y = 0; y < info.height(); y++) { 903 for (int y = 0; y < info.height(); y++) {
904 xform->xform_RGBA_8888(row, row, info.width()); 904 xform->xform_RGB1_8888(row, row, info.width());
905 row = SkTAddOffset<uint32_t>(row, bitmap.rowBytes()); 905 row = SkTAddOffset<uint32_t>(row, bitmap.rowBytes());
906 } 906 }
907 907
908 canvas->drawBitmap(bitmap, 0, 0); 908 canvas->drawBitmap(bitmap, 0, 0);
909 break; 909 break;
910 } 910 }
911 #if defined(SK_TEST_QCMS) 911 #if defined(SK_TEST_QCMS)
912 case kQCMS_HPZR30w_Mode: { 912 case kQCMS_HPZR30w_Mode: {
913 sk_sp<SkData> srcData = codec->getICCData(); 913 sk_sp<SkData> srcData = codec->getICCData();
914 SkAutoTCallVProc<qcms_profile, qcms_profile_release> 914 SkAutoTCallVProc<qcms_profile, qcms_profile_release>
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 skr.visit(i, drawsAsSingletonPictures); 1543 skr.visit(i, drawsAsSingletonPictures);
1544 } 1544 }
1545 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); 1545 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture());
1546 1546
1547 canvas->drawPicture(macroPic); 1547 canvas->drawPicture(macroPic);
1548 return check_against_reference(bitmap, src, fSink); 1548 return check_against_reference(bitmap, src, fSink);
1549 }); 1549 });
1550 } 1550 }
1551 1551
1552 } // namespace DM 1552 } // namespace DM
OLDNEW
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698