OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 ImageFrame::ImageFrame() | 35 ImageFrame::ImageFrame() |
36 : m_bitmap(NativeImageSkia::create()) | 36 : m_bitmap(NativeImageSkia::create()) |
37 , m_allocator(0) | 37 , m_allocator(0) |
38 , m_hasAlpha(false) | 38 , m_hasAlpha(false) |
39 , m_status(FrameEmpty) | 39 , m_status(FrameEmpty) |
40 , m_duration(0) | 40 , m_duration(0) |
41 , m_disposalMethod(DisposeNotSpecified) | 41 , m_disposalMethod(DisposeNotSpecified) |
42 , m_premultiplyAlpha(true) | 42 , m_premultiplyAlpha(true) |
| 43 , m_requiredPreviousFrameIndex(notFound) |
| 44 #if !ASSERT_DISABLED |
| 45 , m_requiredPreviousFrameIndexValid(false) |
| 46 #endif |
43 { | 47 { |
44 } | 48 } |
45 | 49 |
46 ImageFrame& ImageFrame::operator=(const ImageFrame& other) | 50 ImageFrame& ImageFrame::operator=(const ImageFrame& other) |
47 { | 51 { |
48 if (this == &other) | 52 if (this == &other) |
49 return *this; | 53 return *this; |
50 | 54 |
51 m_bitmap = other.m_bitmap->clone(); | 55 m_bitmap = other.m_bitmap->clone(); |
52 // Keep the pixels locked since we will be writing directly into the | 56 // Keep the pixels locked since we will be writing directly into the |
53 // bitmap throughout this object's lifetime. | 57 // bitmap throughout this object's lifetime. |
54 m_bitmap->bitmap().lockPixels(); | 58 m_bitmap->bitmap().lockPixels(); |
55 setMemoryAllocator(other.allocator()); | 59 setMemoryAllocator(other.allocator()); |
56 setOriginalFrameRect(other.originalFrameRect()); | 60 setOriginalFrameRect(other.originalFrameRect()); |
57 setStatus(other.status()); | 61 setStatus(other.status()); |
58 setDuration(other.duration()); | 62 setDuration(other.duration()); |
59 setDisposalMethod(other.disposalMethod()); | 63 setDisposalMethod(other.disposalMethod()); |
60 setPremultiplyAlpha(other.premultiplyAlpha()); | 64 setPremultiplyAlpha(other.premultiplyAlpha()); |
| 65 setRequiredPreviousFrameIndex(other.requiredPreviousFrameIndex()); |
61 // Be sure that this is called after we've called setStatus(), since we | 66 // Be sure that this is called after we've called setStatus(), since we |
62 // look at our status to know what to do with the alpha value. | 67 // look at our status to know what to do with the alpha value. |
63 setHasAlpha(other.hasAlpha()); | 68 setHasAlpha(other.hasAlpha()); |
64 return *this; | 69 return *this; |
65 } | 70 } |
66 | 71 |
67 void ImageFrame::clearPixelData() | 72 void ImageFrame::clearPixelData() |
68 { | 73 { |
69 m_bitmap->bitmap().reset(); | 74 m_bitmap->bitmap().reset(); |
70 m_status = FrameEmpty; | 75 m_status = FrameEmpty; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 141 } |
137 } | 142 } |
138 | 143 |
139 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 144 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
140 { | 145 { |
141 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); | 146 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); |
142 info.addMember(m_bitmap, "bitmap"); | 147 info.addMember(m_bitmap, "bitmap"); |
143 } | 148 } |
144 | 149 |
145 } // namespace WebCore | 150 } // namespace WebCore |
OLD | NEW |