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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp

Issue 1925533003: High CPU and increased memory usage fix for high-res (GIF, WEBP...) animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits related to review #31 Created 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 17 matching lines...) Expand all
28 #include "platform/PlatformInstrumentation.h" 28 #include "platform/PlatformInstrumentation.h"
29 #include "platform/SharedBuffer.h" 29 #include "platform/SharedBuffer.h"
30 #include "platform/TraceEvent.h" 30 #include "platform/TraceEvent.h"
31 #include "platform/graphics/ImageFrameGenerator.h" 31 #include "platform/graphics/ImageFrameGenerator.h"
32 #include "platform/image-decoders/ImageDecoder.h" 32 #include "platform/image-decoders/ImageDecoder.h"
33 #include "platform/image-decoders/SegmentReader.h" 33 #include "platform/image-decoders/SegmentReader.h"
34 #include "third_party/skia/include/core/SkData.h" 34 #include "third_party/skia/include/core/SkData.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> f rameGenerator, const SkImageInfo& info, PassRefPtr<SegmentReader> data, bool all DataReceived, size_t index) 38 DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> f rameGenerator, const SkImageInfo& info, PassRefPtr<SegmentReader> data, bool all DataReceived, size_t index, uint32_t uniqueID)
39 : SkImageGenerator(info) 39 : SkImageGenerator(info, uniqueID)
40 , m_frameGenerator(frameGenerator) 40 , m_frameGenerator(frameGenerator)
41 , m_data(data) 41 , m_data(data)
42 , m_allDataReceived(allDataReceived) 42 , m_allDataReceived(allDataReceived)
43 , m_frameIndex(index) 43 , m_frameIndex(index)
44 , m_canYUVDecode(false) 44 , m_canYUVDecode(false)
45 { 45 {
46 } 46 }
47 47
48 DecodingImageGenerator::~DecodingImageGenerator() 48 DecodingImageGenerator::~DecodingImageGenerator()
49 { 49 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.heigh t()); 123 const SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.heigh t());
124 124
125 RefPtr<ImageFrameGenerator> frame = ImageFrameGenerator::create(SkISize::Mak e(size.width(), size.height()), false); 125 RefPtr<ImageFrameGenerator> frame = ImageFrameGenerator::create(SkISize::Mak e(size.width(), size.height()), false);
126 if (!frame) 126 if (!frame)
127 return 0; 127 return 0;
128 128
129 return new DecodingImageGenerator(frame, info, segmentReader.release(), true , 0); 129 return new DecodingImageGenerator(frame, info, segmentReader.release(), true , 0);
130 } 130 }
131 131
132 } // namespace blink 132 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698