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

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

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the Win build. Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // or return CopyBackingStore if it doesn't. 109 // or return CopyBackingStore if it doesn't.
110 static BackingStoreCopy fastCopyImageMode(); 110 static BackingStoreCopy fastCopyImageMode();
111 111
112 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSyste m }; 112 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSyste m };
113 113
114 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, Coord inateSystem = LogicalCoordinateSystem) const; 114 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, Coord inateSystem = LogicalCoordinateSystem) const;
115 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, Coor dinateSystem = LogicalCoordinateSystem) const; 115 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, Coor dinateSystem = LogicalCoordinateSystem) const;
116 116
117 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& so urceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem); 117 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& so urceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
118 118
119 void convertToLuminanceMask();
120
121 String toDataURL(const String& mimeType, const double* quality = 0, Coordina teSystem = LogicalCoordinateSystem) const; 119 String toDataURL(const String& mimeType, const double* quality = 0, Coordina teSystem = LogicalCoordinateSystem) const;
122 AffineTransform baseTransform() const { return AffineTransform(); } 120 AffineTransform baseTransform() const { return AffineTransform(); }
123 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace) ; 121 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace) ;
124 static const Vector<uint8_t>& getLinearRgbLUT();
125 static const Vector<uint8_t>& getDeviceRgbLUT();
126 WebKit::WebLayer* platformLayer() const; 122 WebKit::WebLayer* platformLayer() const;
127 123
128 // FIXME: current implementations of this method have the restriction that t hey only work 124 // FIXME: current implementations of this method have the restriction that t hey only work
129 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0 , as specified in 125 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0 , as specified in
130 // Extensions3D::canUseCopyTextureCHROMIUM(). 126 // Extensions3D::canUseCopyTextureCHROMIUM().
131 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, G C3Denum, GC3Dint, bool, bool); 127 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, G C3Denum, GC3Dint, bool, bool);
132 128
133 private: 129 private:
134 bool isValid() const; 130 bool isValid() const;
135 131
136 void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0 , 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNorm al, bool useLowQualityScale = false); 132 void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0 , 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNorm al, bool useLowQualityScale = false);
137 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, BlendMode); 133 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, BlendMode);
134 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS pace, ColorSpace dstColorSpace);
138 135
139 friend class GraphicsContext; 136 friend class GraphicsContext;
140 friend class GeneratedImage; 137 friend class GeneratedImage;
141 friend class CrossfadeGeneratedImage; 138 friend class CrossfadeGeneratedImage;
142 friend class GeneratorGeneratedImage; 139 friend class GeneratorGeneratedImage;
140 friend class SkiaImageFilterBuilder;
143 141
144 IntSize m_size; 142 IntSize m_size;
145 IntSize m_logicalSize; 143 IntSize m_logicalSize;
146 float m_resolutionScale; 144 float m_resolutionScale;
147 OwnPtr<SkCanvas> m_canvas; 145 OwnPtr<SkCanvas> m_canvas;
148 OwnPtr<GraphicsContext> m_context; 146 OwnPtr<GraphicsContext> m_context;
149 OwnPtr<Canvas2DLayerBridge> m_layerBridge; 147 OwnPtr<Canvas2DLayerBridge> m_layerBridge;
150 148
151 // This constructor will place its success into the given out-variable 149 // This constructor will place its success into the given out-variable
152 // so that create() knows when it should return failure. 150 // so that create() knows when it should return failure.
153 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod e, bool& success); 151 ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMod e, bool& success);
154 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b ool hasAlpha, bool& success); 152 ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, b ool hasAlpha, bool& success);
155 }; 153 };
156 154
157 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double * quality); 155 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double * quality);
158 156
159 } // namespace WebCore 157 } // namespace WebCore
160 158
161 #endif // ImageBuffer_h 159 #endif // ImageBuffer_h
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsTypes.h ('k') | Source/core/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698