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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/FrameData.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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
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 25 matching lines...) Expand all
36 , m_hasAlpha(true) 36 , m_hasAlpha(true)
37 , m_frameBytes(0) 37 , m_frameBytes(0)
38 { 38 {
39 } 39 }
40 40
41 FrameData::~FrameData() 41 FrameData::~FrameData()
42 { 42 {
43 clear(true); 43 clear(true);
44 } 44 }
45 45
46 bool FrameData::clear(bool clearMetadata) 46 void FrameData::clear(bool clearMetadata)
47 { 47 {
48 if (clearMetadata) 48 if (clearMetadata)
49 m_haveMetadata = false; 49 m_haveMetadata = false;
50 50
51 m_orientation = DefaultImageOrientation; 51 m_orientation = DefaultImageOrientation;
52 m_frameBytes = 0; 52 m_frameBytes = 0;
53
54 if (m_frame) {
55 m_frame.clear();
56 return true;
57 }
58 return false;
59 } 53 }
60 54
61 } // namespace blink 55 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698