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

Side by Side Diff: src/codec/SkPngCodec.cpp

Issue 2319293002: Rename SkColorSpace::GammaNamed to SkColorSpace::RenderTargetGamma (Closed)
Patch Set: Keep compatible with Chrome Created 4 years, 3 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 | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpace.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 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 float value = png_inverted_fixed_point_to_float(gamma); 322 float value = png_inverted_fixed_point_to_float(gamma);
323 gammas[0] = value; 323 gammas[0] = value;
324 gammas[1] = value; 324 gammas[1] = value;
325 gammas[2] = value; 325 gammas[2] = value;
326 326
327 return SkColorSpace_Base::NewRGB(gammas, toXYZD50); 327 return SkColorSpace_Base::NewRGB(gammas, toXYZD50);
328 } 328 }
329 329
330 // Default to sRGB gamma if the image has color space information, 330 // Default to sRGB gamma if the image has color space information,
331 // but does not specify gamma. 331 // but does not specify gamma.
332 return SkColorSpace::NewRGB(SkColorSpace::kSRGB_GammaNamed, toXYZD50); 332 return SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma, toXYZ D50);
333 } 333 }
334 334
335 // Last, check for gamma. 335 // Last, check for gamma.
336 if (PNG_INFO_gAMA == png_get_gAMA_fixed(png_ptr, info_ptr, &gamma)) { 336 if (PNG_INFO_gAMA == png_get_gAMA_fixed(png_ptr, info_ptr, &gamma)) {
337 337
338 // Set the gammas. 338 // Set the gammas.
339 float value = png_inverted_fixed_point_to_float(gamma); 339 float value = png_inverted_fixed_point_to_float(gamma);
340 gammas[0] = value; 340 gammas[0] = value;
341 gammas[1] = value; 341 gammas[1] = value;
342 gammas[2] = value; 342 gammas[2] = value;
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 SkCodec* outCodec; 945 SkCodec* outCodec;
946 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) { 946 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) {
947 // Codec has taken ownership of the stream. 947 // Codec has taken ownership of the stream.
948 SkASSERT(outCodec); 948 SkASSERT(outCodec);
949 streamDeleter.release(); 949 streamDeleter.release();
950 return outCodec; 950 return outCodec;
951 } 951 }
952 952
953 return nullptr; 953 return nullptr;
954 } 954 }
OLDNEW
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698