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

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

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
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) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 ASSERT(endX <= width()); 112 ASSERT(endX <= width());
113 ASSERT(startY < height()); 113 ASSERT(startY < height());
114 ASSERT(endY <= height()); 114 ASSERT(endY <= height());
115 const int rowBytes = (endX - startX) * sizeof(PixelData); 115 const int rowBytes = (endX - startX) * sizeof(PixelData);
116 const PixelData* const startAddr = getAddr(startX, startY); 116 const PixelData* const startAddr = getAddr(startX, startY);
117 for (int destY = startY + 1; destY < endY; ++destY) 117 for (int destY = startY + 1; destY < endY; ++destY)
118 memcpy(getAddr(startX, destY), startAddr, rowBytes); 118 memcpy(getAddr(startX, destY), startAddr, rowBytes);
119 } 119 }
120 120
121 // Allocates space for the pixel data. Must be called before any pixels 121 // Allocates space for the pixel data. Must be called before any pixels
122 // are written. Must only be called once. Returns whether allocation 122 // are written. Must only be called once. The specified color space may
123 // succeeded. 123 // be nullptr if and only if color correct rendering is enabled. Returns
124 // whether allocation succeeded.
124 bool setSizeAndColorSpace(int newWidth, int newHeight, sk_sp<SkColorSpace>); 125 bool setSizeAndColorSpace(int newWidth, int newHeight, sk_sp<SkColorSpace>);
125 126
126 bool hasAlpha() const; 127 bool hasAlpha() const;
127 const IntRect& originalFrameRect() const { return m_originalFrameRect; } 128 const IntRect& originalFrameRect() const { return m_originalFrameRect; }
128 Status getStatus() const { return m_status; } 129 Status getStatus() const { return m_status; }
129 unsigned duration() const { return m_duration; } 130 unsigned duration() const { return m_duration; }
130 DisposalMethod getDisposalMethod() const { return m_disposalMethod; } 131 DisposalMethod getDisposalMethod() const { return m_disposalMethod; }
131 AlphaBlendSource getAlphaBlendSource() const { return m_alphaBlendSource; } 132 AlphaBlendSource getAlphaBlendSource() const { return m_alphaBlendSource; }
132 bool premultiplyAlpha() const { return m_premultiplyAlpha; } 133 bool premultiplyAlpha() const { return m_premultiplyAlpha; }
133 SkBitmap::Allocator* allocator() const { return m_allocator; } 134 SkBitmap::Allocator* allocator() const { return m_allocator; }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // frames whose original rect was smaller than the overall image size. 239 // frames whose original rect was smaller than the overall image size.
239 IntRect m_originalFrameRect; 240 IntRect m_originalFrameRect;
240 Status m_status; 241 Status m_status;
241 unsigned m_duration; 242 unsigned m_duration;
242 DisposalMethod m_disposalMethod; 243 DisposalMethod m_disposalMethod;
243 AlphaBlendSource m_alphaBlendSource; 244 AlphaBlendSource m_alphaBlendSource;
244 bool m_premultiplyAlpha; 245 bool m_premultiplyAlpha;
245 // True if the pixels changed, but the bitmap has not yet been notified. 246 // True if the pixels changed, but the bitmap has not yet been notified.
246 bool m_pixelsChanged; 247 bool m_pixelsChanged;
247 248
249 // The color space of the image. This will never be null. If a color profile
250 // was not embedded in the image, this will be set to sRGB.
251 sk_sp<SkColorSpace> m_colorSpace;
252
248 // The frame that must be decoded before this frame can be decoded. 253 // The frame that must be decoded before this frame can be decoded.
249 // WTF::kNotFound if this frame doesn't require any previous frame. 254 // WTF::kNotFound if this frame doesn't require any previous frame.
250 // This is used by ImageDecoder::clearCacheExceptFrame(), and will never 255 // This is used by ImageDecoder::clearCacheExceptFrame(), and will never
251 // be read for image formats that do not have multiple frames. 256 // be read for image formats that do not have multiple frames.
252 size_t m_requiredPreviousFrameIndex; 257 size_t m_requiredPreviousFrameIndex;
253 }; 258 };
254 259
255 } // namespace blink 260 } // namespace blink
256 261
257 #endif 262 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698