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

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

Issue 868743002: Use SkXfermode::Mode in code related to Image. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 5 years, 11 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
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/platform/graphics/Image.cpp » ('j') | 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ImageObserver* imageObserver() const { return m_imageObserver; } 119 ImageObserver* imageObserver() const { return m_imageObserver; }
120 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } 120 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
121 121
122 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 122 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
123 123
124 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } 124 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; }
125 125
126 virtual PassRefPtr<Image> imageForDefaultFrame(); 126 virtual PassRefPtr<Image> imageForDefaultFrame();
127 127
128 virtual void drawPattern(GraphicsContext*, const FloatRect&, 128 virtual void drawPattern(GraphicsContext*, const FloatRect&,
129 const FloatSize&, const FloatPoint& phase, CompositeOperator, 129 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode,
130 const FloatRect&, WebBlendMode = WebBlendModeNormal, const IntSize& repe atSpacing = IntSize()); 130 const FloatRect&, const IntSize& repeatSpacing = IntSize());
131 131
132 #if ENABLE(ASSERT) 132 #if ENABLE(ASSERT)
133 virtual bool notSolidColor() { return true; } 133 virtual bool notSolidColor() { return true; }
134 #endif 134 #endif
135 135
136 protected: 136 protected:
137 Image(ImageObserver* = 0); 137 Image(ImageObserver* = 0);
138 138
139 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c onst Color&, CompositeOperator); 139 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, c onst Color&, SkXfermode::Mode);
140 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values. 140 static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values.
141 141
142 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, CompositeOperator, WebBlendMode, RespectImageOrientationEnum) = 0; 142 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec t& srcRect, SkXfermode::Mode, RespectImageOrientationEnum) = 0;
143 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, 143 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize,
144 CompositeOperator, WebBlendMode, const IntSize& repeatSpacing); 144 SkXfermode::Mode, const IntSize& repeatSpacing);
145 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, Compo siteOperator); 145 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, SkXfe rmode::Mode);
146 146
147 // Supporting tiled drawing 147 // Supporting tiled drawing
148 virtual bool mayFillWithSolidColor() { return false; } 148 virtual bool mayFillWithSolidColor() { return false; }
149 virtual Color solidColor() const { return Color(); } 149 virtual Color solidColor() const { return Color(); }
150 150
151 private: 151 private:
152 RefPtr<SharedBuffer> m_encodedImageData; 152 RefPtr<SharedBuffer> m_encodedImageData;
153 ImageObserver* m_imageObserver; 153 ImageObserver* m_imageObserver;
154 }; 154 };
155 155
156 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 156 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
157 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 157 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
158 158
159 } // namespace blink 159 } // namespace blink
160 160
161 #endif 161 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | Source/platform/graphics/Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698