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

Side by Side Diff: Source/platform/graphics/Image.h

Issue 713263002: Use the viewBox when scaling <svg:image>s non-uniformly w/ pAR=none (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: The computeImageViewportSize approach. Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/RenderSVGImage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // image frame contains only resources from its own security origin. 77 // image frame contains only resources from its own security origin.
78 virtual bool currentFrameHasSingleSecurityOrigin() const { return false; } 78 virtual bool currentFrameHasSingleSecurityOrigin() const { return false; }
79 79
80 static Image* nullImage(); 80 static Image* nullImage();
81 bool isNull() const { return size().isEmpty(); } 81 bool isNull() const { return size().isEmpty(); }
82 82
83 virtual void setContainerSize(const IntSize&) { } 83 virtual void setContainerSize(const IntSize&) { }
84 virtual bool usesContainerSize() const { return false; } 84 virtual bool usesContainerSize() const { return false; }
85 virtual bool hasRelativeWidth() const { return false; } 85 virtual bool hasRelativeWidth() const { return false; }
86 virtual bool hasRelativeHeight() const { return false; } 86 virtual bool hasRelativeHeight() const { return false; }
87
88 // Computes (extracts) the intrinsic dimensions and ratio from the Image. Th e intrinsic ratio
89 // will be the 'viewport' of the image. (Same as the dimensions for a raster image. For SVG
90 // images it can be the dimensions defined by the 'viewBox'.)
87 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio); 91 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio);
88 92
89 virtual IntSize size() const = 0; 93 virtual IntSize size() const = 0;
90 IntRect rect() const { return IntRect(IntPoint(), size()); } 94 IntRect rect() const { return IntRect(IntPoint(), size()); }
91 int width() const { return size().width(); } 95 int width() const { return size().width(); }
92 int height() const { return size().height(); } 96 int height() const { return size().height(); }
93 virtual bool getHotSpot(IntPoint&) const { return false; } 97 virtual bool getHotSpot(IntPoint&) const { return false; }
94 98
95 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); 99 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
96 virtual bool dataChanged(bool /*allDataReceived*/) { return false; } 100 virtual bool dataChanged(bool /*allDataReceived*/) { return false; }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 RefPtr<SharedBuffer> m_encodedImageData; 153 RefPtr<SharedBuffer> m_encodedImageData;
150 ImageObserver* m_imageObserver; 154 ImageObserver* m_imageObserver;
151 }; 155 };
152 156
153 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 157 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
154 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 158 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
155 159
156 } // namespace blink 160 } // namespace blink
157 161
158 #endif 162 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698