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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp

Issue 2462803002: Plumb color space to DecodingImageGenerator and ImageFrameGenerator (Closed)
Patch Set: Incorporate review feedback Created 4 years, 1 month 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 | « no previous file | third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.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 (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // We just need the size of the image, so we have to temporarily create an 140 // We just need the size of the image, so we have to temporarily create an
141 // ImageDecoder. Since we only need the size, the premul and gamma settings 141 // ImageDecoder. Since we only need the size, the premul and gamma settings
142 // don't really matter. 142 // don't really matter.
143 std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create( 143 std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(
144 segmentReader, true, ImageDecoder::AlphaPremultiplied, 144 segmentReader, true, ImageDecoder::AlphaPremultiplied,
145 ImageDecoder::ColorSpaceApplied); 145 ImageDecoder::ColorSpaceApplied);
146 if (!decoder || !decoder->isSizeAvailable()) 146 if (!decoder || !decoder->isSizeAvailable())
147 return nullptr; 147 return nullptr;
148 148
149 const IntSize size = decoder->size(); 149 const IntSize size = decoder->size();
150 const SkImageInfo info = 150 const SkImageInfo info = SkImageInfo::MakeN32(
151 SkImageInfo::MakeN32Premul(size.width(), size.height()); 151 size.width(), size.height(), kPremul_SkAlphaType, decoder->colorSpace());
152 152
153 RefPtr<ImageFrameGenerator> frame = ImageFrameGenerator::create( 153 RefPtr<ImageFrameGenerator> frame = ImageFrameGenerator::create(
154 SkISize::Make(size.width(), size.height()), false); 154 SkISize::Make(size.width(), size.height()), decoder->colorSpace(), false);
155 if (!frame) 155 if (!frame)
156 return nullptr; 156 return nullptr;
157 157
158 return new DecodingImageGenerator(frame, info, segmentReader.release(), true, 158 return new DecodingImageGenerator(frame, info, segmentReader.release(), true,
159 0); 159 0);
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698