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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 m_bitmap->setDataComplete(); // Tell the bitmap it's done. | 145 m_bitmap->setDataComplete(); // Tell the bitmap it's done. |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 149 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
150 { | 150 { |
151 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); | 151 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); |
152 info.addMember(m_bitmap, "bitmap"); | 152 info.addMember(m_bitmap, "bitmap"); |
153 } | 153 } |
154 | 154 |
| 155 void ImageFrame::zeroFillFrameRect(const IntRect& rect) |
| 156 { |
| 157 if (rect.isEmpty()) |
| 158 return; |
| 159 |
| 160 // FIXME: Can we make this faster using Skia? |
| 161 for (int y = rect.y(); y < rect.maxY(); ++y) { |
| 162 uint8_t* const dst = reinterpret_cast<uint8_t*>(getAddr(rect.x(), rect.y
())); |
| 163 memset(dst, 0, (rect.maxX() - rect.x()) * sizeof(ImageFrame::PixelData))
; |
| 164 } |
| 165 setHasAlpha(true); |
| 166 } |
| 167 |
155 } // namespace WebCore | 168 } // namespace WebCore |
OLD | NEW |