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

Side by Side Diff: Source/WebCore/svg/graphics/SVGImage.h

Issue 13008026: Merge 146227 "Separate SVG image size and container size" (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 public: 44 public:
45 static PassRefPtr<SVGImage> create(ImageObserver* observer) 45 static PassRefPtr<SVGImage> create(ImageObserver* observer)
46 { 46 {
47 return adoptRef(new SVGImage(observer)); 47 return adoptRef(new SVGImage(observer));
48 } 48 }
49 49
50 RenderBox* embeddedContentBox() const; 50 RenderBox* embeddedContentBox() const;
51 FrameView* frameView() const; 51 FrameView* frameView() const;
52 52
53 virtual bool isSVGImage() const { return true; } 53 virtual bool isSVGImage() const { return true; }
54 virtual IntSize size() const; 54 virtual IntSize size() const OVERRIDE { return m_intrinsicSize; }
55 55
56 virtual bool hasRelativeWidth() const; 56 virtual bool hasRelativeWidth() const;
57 virtual bool hasRelativeHeight() const; 57 virtual bool hasRelativeHeight() const;
58 58
59 virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) OVERRIDE; 59 virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) OVERRIDE;
60 virtual void stopAnimation() OVERRIDE; 60 virtual void stopAnimation() OVERRIDE;
61 virtual void resetAnimation() OVERRIDE; 61 virtual void resetAnimation() OVERRIDE;
62 62
63 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; 63 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
64 64
65 private: 65 private:
66 friend class SVGImageChromeClient; 66 friend class SVGImageChromeClient;
67 friend class SVGImageForContainer; 67 friend class SVGImageForContainer;
68 68
69 virtual ~SVGImage(); 69 virtual ~SVGImage();
70 70
71 virtual String filenameExtension() const; 71 virtual String filenameExtension() const;
72 72
73 virtual void setContainerSize(const IntSize&); 73 virtual void setContainerSize(const IntSize&);
74 IntSize containerSize() const;
74 virtual bool usesContainerSize() const { return true; } 75 virtual bool usesContainerSize() const { return true; }
75 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio); 76 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio);
76 77
77 virtual bool dataChanged(bool allDataReceived); 78 virtual bool dataChanged(bool allDataReceived);
78 79
79 // FIXME: SVGImages are underreporting decoded sizes and will be unable 80 // FIXME: SVGImages are underreporting decoded sizes and will be unable
80 // to prune because these functions are not implemented yet. 81 // to prune because these functions are not implemented yet.
81 virtual void destroyDecodedData(bool) { } 82 virtual void destroyDecodedData(bool) { }
82 virtual unsigned decodedSize() const { return 0; } 83 virtual unsigned decodedSize() const { return 0; }
83 84
84 virtual NativeImagePtr frameAtIndex(size_t) { return 0; } 85 virtual NativeImagePtr frameAtIndex(size_t) { return 0; }
85 86
86 // FIXME: Implement this to be less conservative. 87 // FIXME: Implement this to be less conservative.
87 virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; } 88 virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
88 89
89 SVGImage(ImageObserver*); 90 SVGImage(ImageObserver*);
90 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe ct& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode); 91 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRe ct& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
91 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR ect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode); 92 void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatR ect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
92 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, 93 void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
93 CompositeOperator, const FloatRect&); 94 CompositeOperator, const FloatRect&);
94 95
95 OwnPtr<SVGImageChromeClient> m_chromeClient; 96 OwnPtr<SVGImageChromeClient> m_chromeClient;
96 OwnPtr<Page> m_page; 97 OwnPtr<Page> m_page;
98 IntSize m_intrinsicSize;
97 }; 99 };
98 } 100 }
99 101
100 #endif // ENABLE(SVG) 102 #endif // ENABLE(SVG)
101 #endif // SVGImage_h 103 #endif // SVGImage_h
OLDNEW
« no previous file with comments | « LayoutTests/svg/as-image/svg-container-size-after-reload-expected.txt ('k') | Source/WebCore/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698