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

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

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Again in StaticBitmapPattern Created 6 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 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 Platform3DObject getBackingTexture(); 118 Platform3DObject getBackingTexture();
119 void didModifyBackingTexture(); 119 void didModifyBackingTexture();
120 120
121 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, bool fromFrontBuf fer = false); 121 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, bool fromFrontBuf fer = false);
122 122
123 void flush(); 123 void flush();
124 124
125 void notifySurfaceInvalid(); 125 void notifySurfaceInvalid();
126 126
127 PassRefPtr<SkImage> newImageSnapshot() const;
128
127 private: 129 private:
128 ImageBuffer(PassOwnPtr<ImageBufferSurface>); 130 ImageBuffer(PassOwnPtr<ImageBufferSurface>);
129 131
130 void draw(GraphicsContext*, const FloatRect&, const FloatRect* = 0, Composit eOperator = CompositeSourceOver, WebBlendMode = WebBlendModeNormal); 132 void draw(GraphicsContext*, const FloatRect&, const FloatRect* = 0, Composit eOperator = CompositeSourceOver, WebBlendMode = WebBlendModeNormal);
131 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, WebBlendMode, const IntSize& repeatSpacing = IntSize()); 133 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, WebBlendMode, const IntSize& repeatSpacing = IntSize());
132 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS pace, ColorSpace dstColorSpace); 134 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS pace, ColorSpace dstColorSpace);
133 135
134 friend class GraphicsContext; 136 friend class GraphicsContext;
135 friend class GeneratedImage; 137 friend class GeneratedImage;
136 friend class CrossfadeGeneratedImage; 138 friend class CrossfadeGeneratedImage;
(...skipping 12 matching lines...) Expand all
149 151
150 IntSize m_size; 152 IntSize m_size;
151 RefPtr<Uint8ClampedArray> m_data; 153 RefPtr<Uint8ClampedArray> m_data;
152 }; 154 };
153 155
154 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality); 156 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);
155 157
156 } // namespace blink 158 } // namespace blink
157 159
158 #endif // ImageBuffer_h 160 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698