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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp

Issue 2471193002: Fix double-move of SkColorSpace (Closed)
Patch Set: 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 | no next file » | 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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { 117 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
118 DCHECK(colorSpace); 118 DCHECK(colorSpace);
119 m_colorSpace = std::move(colorSpace); 119 m_colorSpace = std::move(colorSpace);
120 } else { 120 } else {
121 DCHECK(!colorSpace); 121 DCHECK(!colorSpace);
122 } 122 }
123 123
124 m_bitmap.setInfo(SkImageInfo::MakeN32( 124 m_bitmap.setInfo(SkImageInfo::MakeN32(
125 newWidth, newHeight, 125 newWidth, newHeight,
126 m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType, 126 m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType,
127 std::move(colorSpace))); 127 m_colorSpace));
128 if (!m_bitmap.tryAllocPixels(m_allocator, 0)) 128 if (!m_bitmap.tryAllocPixels(m_allocator, 0))
129 return false; 129 return false;
130 130
131 zeroFillPixelData(); 131 zeroFillPixelData();
132 return true; 132 return true;
133 } 133 }
134 134
135 bool ImageFrame::hasAlpha() const { 135 bool ImageFrame::hasAlpha() const {
136 return m_hasAlpha; 136 return m_hasAlpha;
137 } 137 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // If the frame is not fully loaded, there will be transparent pixels, 174 // If the frame is not fully loaded, there will be transparent pixels,
175 // so we can't tell skia we're opaque, even for image types that logically 175 // so we can't tell skia we're opaque, even for image types that logically
176 // always are (e.g. jpeg). 176 // always are (e.g. jpeg).
177 if (!m_hasAlpha && m_status == FrameComplete) 177 if (!m_hasAlpha && m_status == FrameComplete)
178 return kOpaque_SkAlphaType; 178 return kOpaque_SkAlphaType;
179 179
180 return m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; 180 return m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType;
181 } 181 }
182 182
183 } // namespace blink 183 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698