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

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

Issue 13980003: Add animation support for WebP images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Create and use zeroFillPixelData() Created 7 years, 5 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/platform/image-decoders/ImageDecoderTest.cpp ('k') | Source/core/platform/image-decoders/gif/GIFImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698