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

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

Issue 25627006: Generalize ImageForContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 ImageObserver* imageObserver() const { return m_imageObserver; } 106 ImageObserver* imageObserver() const { return m_imageObserver; }
107 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } 107 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
108 108
109 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 109 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
110 110
111 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return 0; } 111 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return 0; }
112 112
113 virtual void drawPattern(GraphicsContext*, const FloatRect&, 113 virtual void drawPattern(GraphicsContext*, const FloatRect&,
114 const FloatSize&, const FloatPoint& phase, CompositeOperator, 114 const FloatSize&, const FloatPoint& phase, CompositeOperator,
115 const FloatRect&, BlendMode = BlendModeNormal); 115 const FloatRect&, BlendMode = BlendModeNormal);
116 virtual void drawForContainer(GraphicsContext*, const FloatSize, float, cons t FloatRect&, const FloatRect&, CompositeOperator, BlendMode);
117 virtual void drawPatternForContainer(GraphicsContext*, const FloatSize, floa t, const FloatRect&, const FloatSize&, const FloatPoint&,
118 CompositeOperator, const FloatRect&, BlendMode);
116 119
117 #if !ASSERT_DISABLED 120 #if !ASSERT_DISABLED
118 virtual bool notSolidColor() { return true; } 121 virtual bool notSolidColor() { return true; }
119 #endif 122 #endif
120 123
121 protected: 124 protected:
122 Image(ImageObserver* = 0); 125 Image(ImageObserver* = 0);
123 126
124 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c onst Color&, CompositeOperator); 127 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c onst Color&, CompositeOperator);
125 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values. 128 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values.
126 129
127 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, BlendMode) = 0; 130 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, BlendMode) = 0;
128 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum); 131 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum);
129 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, 132 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize,
130 CompositeOperator, BlendMode); 133 CompositeOperator, BlendMode);
131 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, Compo siteOperator); 134 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, Compo siteOperator);
132 135
133 // Supporting tiled drawing 136 // Supporting tiled drawing
134 virtual bool mayFillWithSolidColor() { return false; } 137 virtual bool mayFillWithSolidColor() { return false; }
135 virtual Color solidColor() const { return Color(); } 138 virtual Color solidColor() const { return Color(); }
136 139
137 private: 140 private:
138 RefPtr<SharedBuffer> m_encodedImageData; 141 RefPtr<SharedBuffer> m_encodedImageData;
139 ImageObserver* m_imageObserver; 142 ImageObserver* m_imageObserver;
140 }; 143 };
141 144
142 } 145 }
143 146
144 #endif 147 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698