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

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

Issue 1767633002: Support canvas size as default object size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-default-object-size
Patch Set: Save image size on stack Created 4 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void destroyDecodedData(bool) override { } 103 void destroyDecodedData(bool) override { }
104 104
105 // FIXME: Implement this to be less conservative. 105 // FIXME: Implement this to be less conservative.
106 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; } 106 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { return false; }
107 107
108 SVGImage(ImageObserver*); 108 SVGImage(ImageObserver*);
109 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override; 109 void draw(SkCanvas*, const SkPaint&, const FloatRect& fromRect, const FloatR ect& toRect, RespectImageOrientationEnum, ImageClampingMode) override;
110 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&, const KURL&); 110 void drawForContainer(SkCanvas*, const SkPaint&, const FloatSize, float, con st FloatRect&, const FloatRect&, const KURL&);
111 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&, 111 void drawPatternForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
112 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons t KURL&); 112 SkXfermode::Mode, const FloatRect&, const FloatSize& repeatSpacing, cons t KURL&);
113 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&); 113 PassRefPtr<SkImage> imageForCurrentFrameForContainer(const KURL&, const Floa tSize& containerSize);
114 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons t FloatRect& toRect, RespectImageOrientationEnum, 114 void drawInternal(SkCanvas*, const SkPaint&, const FloatRect& fromRect, cons t FloatRect& toRect, RespectImageOrientationEnum,
115 ImageClampingMode, const KURL&); 115 ImageClampingMode, const KURL&);
116 116
117 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient; 117 OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient;
118 OwnPtrWillBePersistent<Page> m_page; 118 OwnPtrWillBePersistent<Page> m_page;
119 119
120 // When an SVG image has no intrinsic size the size depends on the 120 // When an SVG image has no intrinsic size the size depends on the
121 // default object size, which in turn depends on the 121 // default object size, which in turn depends on the
122 // container. SVGImage may belong to multiple containers so the 122 // container. SVGImage may belong to multiple containers so the
123 // final image size can't be known in 123 // final image size can't be known in
(...skipping 20 matching lines...) Expand all
144 m_image->setImageObserver(m_observer); 144 m_image->setImageObserver(m_observer);
145 } 145 }
146 private: 146 private:
147 Image* m_image; 147 Image* m_image;
148 RawPtrWillBeMember<ImageObserver> m_observer; 148 RawPtrWillBeMember<ImageObserver> m_observer;
149 }; 149 };
150 150
151 } // namespace blink 151 } // namespace blink
152 152
153 #endif // SVGImage_h 153 #endif // SVGImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698