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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.h

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: Rebasing. DCHECK. Thanks fmalita@. 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 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 LayoutReplaced* embeddedReplacedContent() const; 53 LayoutReplaced* embeddedReplacedContent() const;
54 54
55 bool isSVGImage() const override { return true; } 55 bool isSVGImage() const override { return true; }
56 bool isTextureBacked() override { return false; } 56 bool isTextureBacked() override { return false; }
57 IntSize size() const override { return m_intrinsicSize; } 57 IntSize size() const override { return m_intrinsicSize; }
58 58
59 bool currentFrameHasSingleSecurityOrigin() const override; 59 bool currentFrameHasSingleSecurityOrigin() const override;
60 60
61 void startAnimation(CatchUpAnimation = CatchUp) override; 61 void startAnimation(CatchUpAnimation = CatchUp) override;
62 void stopAnimation() override;
63 void resetAnimation() override; 62 void resetAnimation() override;
64 63
65 // Advances an animated image. This will trigger an animation update for CSS 64 // Advances an animated image. This will trigger an animation update for CSS
66 // and advance the SMIL timeline by one frame. 65 // and advance the SMIL timeline by one frame.
67 void advanceAnimationForTesting() override; 66 void advanceAnimationForTesting() override;
68 67
69 PassRefPtr<SkImage> imageForCurrentFrame() override; 68 PassRefPtr<SkImage> imageForCurrentFrame() override;
70 69
71 // Returns the SVG image document's frame. 70 // Returns the SVG image document's frame.
72 FrameView* frameView() const; 71 FrameView* frameView() const;
(...skipping 19 matching lines...) Expand all
92 91
93 String filenameExtension() const override; 92 String filenameExtension() const override;
94 93
95 IntSize containerSize() const; 94 IntSize containerSize() const;
96 bool usesContainerSize() const override { return true; } 95 bool usesContainerSize() const override { return true; }
97 96
98 bool dataChanged(bool allDataReceived) override; 97 bool dataChanged(bool allDataReceived) override;
99 98
100 // FIXME: SVGImages are underreporting decoded sizes and will be unable 99 // FIXME: SVGImages are underreporting decoded sizes and will be unable
101 // to prune because these functions are not implemented yet. 100 // to prune because these functions are not implemented yet.
102 void destroyDecodedData(bool) override { } 101 void destroyDecodedData() override { }
103 102
104 // FIXME: Implement this to be less conservative. 103 // FIXME: Implement this to be less conservative.
105 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; } 104 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
106 105
107 SVGImage(ImageObserver*); 106 SVGImage(ImageObserver*);
108 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; 107 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override;
109 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&, const KURL&); 108 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&, const KURL&);
110 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&, 109 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
111 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons t KURL&); 110 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons t KURL&);
112 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&, const Floa tSize& containerSize); 111 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&, const Floa tSize& containerSize);
(...skipping 28 matching lines...) Expand all
141 { 140 {
142 m_image->setImageObserverDisabled(false); 141 m_image->setImageObserverDisabled(false);
143 } 142 }
144 private: 143 private:
145 Image* m_image; 144 Image* m_image;
146 }; 145 };
147 146
148 } // namespace blink 147 } // namespace blink
149 148
150 #endif // SVGImage_h 149 #endif // SVGImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698