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

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

Issue 327323002: Start removing the double-negative !ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/Path.cpp ('k') | Source/platform/image-decoders/ImageFrame.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 (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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 SkBitmap::Allocator* allocator() const { return m_allocator; } 121 SkBitmap::Allocator* allocator() const { return m_allocator; }
122 const SkBitmap& getSkBitmap() const { return m_bitmap; } 122 const SkBitmap& getSkBitmap() const { return m_bitmap; }
123 // Returns true if the pixels changed, but the bitmap has not yet been notif ied. 123 // Returns true if the pixels changed, but the bitmap has not yet been notif ied.
124 bool pixelsChanged() const { return m_pixelsChanged; } 124 bool pixelsChanged() const { return m_pixelsChanged; }
125 125
126 size_t requiredPreviousFrameIndex() const 126 size_t requiredPreviousFrameIndex() const
127 { 127 {
128 ASSERT(m_requiredPreviousFrameIndexValid); 128 ASSERT(m_requiredPreviousFrameIndexValid);
129 return m_requiredPreviousFrameIndex; 129 return m_requiredPreviousFrameIndex;
130 } 130 }
131 #if !ASSERT_DISABLED 131 #if ASSERT_ENABLED
132 bool requiredPreviousFrameIndexValid() const { return m_requiredPreviousFram eIndexValid; } 132 bool requiredPreviousFrameIndexValid() const { return m_requiredPreviousFram eIndexValid; }
133 #endif 133 #endif
134 void setHasAlpha(bool alpha); 134 void setHasAlpha(bool alpha);
135 void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; } 135 void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; }
136 void setStatus(Status); 136 void setStatus(Status);
137 void setDuration(unsigned duration) { m_duration = duration; } 137 void setDuration(unsigned duration) { m_duration = duration; }
138 void setDisposalMethod(DisposalMethod disposalMethod) { m_disposalMethod = d isposalMethod; } 138 void setDisposalMethod(DisposalMethod disposalMethod) { m_disposalMethod = d isposalMethod; }
139 void setAlphaBlendSource(AlphaBlendSource alphaBlendSource) { m_alphaBlendSo urce = alphaBlendSource; } 139 void setAlphaBlendSource(AlphaBlendSource alphaBlendSource) { m_alphaBlendSo urce = alphaBlendSource; }
140 void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premu ltiplyAlpha; } 140 void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premu ltiplyAlpha; }
141 void setMemoryAllocator(SkBitmap::Allocator* allocator) { m_allocator = allo cator; } 141 void setMemoryAllocator(SkBitmap::Allocator* allocator) { m_allocator = allo cator; }
142 void setSkBitmap(const SkBitmap& bitmap) { m_bitmap = bitmap; } 142 void setSkBitmap(const SkBitmap& bitmap) { m_bitmap = bitmap; }
143 // The pixelsChanged flag needs to be set when the raw pixel data was direct ly modified 143 // The pixelsChanged flag needs to be set when the raw pixel data was direct ly modified
144 // (e.g. through a pointer or setRGBA). The flag is usually set after a batc h of changes was made. 144 // (e.g. through a pointer or setRGBA). The flag is usually set after a batc h of changes was made.
145 void setPixelsChanged(bool pixelsChanged) { m_pixelsChanged = pixelsChanged; } 145 void setPixelsChanged(bool pixelsChanged) { m_pixelsChanged = pixelsChanged; }
146 146
147 void setRequiredPreviousFrameIndex(size_t previousFrameIndex) 147 void setRequiredPreviousFrameIndex(size_t previousFrameIndex)
148 { 148 {
149 m_requiredPreviousFrameIndex = previousFrameIndex; 149 m_requiredPreviousFrameIndex = previousFrameIndex;
150 #if !ASSERT_DISABLED 150 #if ASSERT_ENABLED
151 m_requiredPreviousFrameIndexValid = true; 151 m_requiredPreviousFrameIndexValid = true;
152 #endif 152 #endif
153 } 153 }
154 154
155 inline PixelData* getAddr(int x, int y) 155 inline PixelData* getAddr(int x, int y)
156 { 156 {
157 return m_bitmap.getAddr32(x, y); 157 return m_bitmap.getAddr32(x, y);
158 } 158 }
159 159
160 inline void setRGBA(int x, int y, unsigned r, unsigned g, unsigned b, unsign ed a) 160 inline void setRGBA(int x, int y, unsigned r, unsigned g, unsigned b, unsign ed a)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 AlphaBlendSource m_alphaBlendSource; 227 AlphaBlendSource m_alphaBlendSource;
228 bool m_premultiplyAlpha; 228 bool m_premultiplyAlpha;
229 // True if the pixels changed, but the bitmap has not yet been notified. 229 // True if the pixels changed, but the bitmap has not yet been notified.
230 bool m_pixelsChanged; 230 bool m_pixelsChanged;
231 231
232 // The frame that must be decoded before this frame can be decoded. 232 // The frame that must be decoded before this frame can be decoded.
233 // WTF::kNotFound if this frame doesn't require any previous frame. 233 // WTF::kNotFound if this frame doesn't require any previous frame.
234 // This is used by ImageDecoder::clearCacheExceptFrame(), and will never 234 // This is used by ImageDecoder::clearCacheExceptFrame(), and will never
235 // be read for image formats that do not have multiple frames. 235 // be read for image formats that do not have multiple frames.
236 size_t m_requiredPreviousFrameIndex; 236 size_t m_requiredPreviousFrameIndex;
237 #if !ASSERT_DISABLED 237 #if ASSERT_ENABLED
238 bool m_requiredPreviousFrameIndexValid; 238 bool m_requiredPreviousFrameIndexValid;
239 #endif 239 #endif
240 }; 240 };
241 241
242 } // namespace WebCore 242 } // namespace WebCore
243 243
244 #endif 244 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/Path.cpp ('k') | Source/platform/image-decoders/ImageFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698