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

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

Issue 15350006: Decode GIF image frames on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 22 matching lines...) Expand all
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)
43 { 44 {
44 } 45 }
45 46
46 ImageFrame& ImageFrame::operator=(const ImageFrame& other) 47 ImageFrame& ImageFrame::operator=(const ImageFrame& other)
47 { 48 {
48 if (this == &other) 49 if (this == &other)
49 return *this; 50 return *this;
50 51
51 m_bitmap = other.m_bitmap->clone(); 52 m_bitmap = other.m_bitmap->clone();
52 // Keep the pixels locked since we will be writing directly into the 53 // Keep the pixels locked since we will be writing directly into the
53 // bitmap throughout this object's lifetime. 54 // bitmap throughout this object's lifetime.
54 m_bitmap->bitmap().lockPixels(); 55 m_bitmap->bitmap().lockPixels();
55 setMemoryAllocator(other.allocator()); 56 setMemoryAllocator(other.allocator());
56 setOriginalFrameRect(other.originalFrameRect()); 57 setOriginalFrameRect(other.originalFrameRect());
57 setStatus(other.status()); 58 setStatus(other.status());
58 setDuration(other.duration()); 59 setDuration(other.duration());
59 setDisposalMethod(other.disposalMethod()); 60 setDisposalMethod(other.disposalMethod());
60 setPremultiplyAlpha(other.premultiplyAlpha()); 61 setPremultiplyAlpha(other.premultiplyAlpha());
62 setRequiredPreviousFrameIndex(other.requiredPreviousFrameIndex());
61 // Be sure that this is called after we've called setStatus(), since we 63 // 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. 64 // look at our status to know what to do with the alpha value.
63 setHasAlpha(other.hasAlpha()); 65 setHasAlpha(other.hasAlpha());
64 return *this; 66 return *this;
65 } 67 }
66 68
67 void ImageFrame::clearPixelData() 69 void ImageFrame::clearPixelData()
68 { 70 {
69 m_bitmap->bitmap().reset(); 71 m_bitmap->bitmap().reset();
70 m_status = FrameEmpty; 72 m_status = FrameEmpty;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 138 }
137 } 139 }
138 140
139 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 141 void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
140 { 142 {
141 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image); 143 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Image);
142 info.addMember(m_bitmap, "bitmap"); 144 info.addMember(m_bitmap, "bitmap");
143 } 145 }
144 146
145 } // namespace WebCore 147 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698