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

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

Issue 1284603003: WebGL: optimize webgl.texSubImage2D(video) path. (Blink side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 5 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
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour ceSize, const IntRect& sourceRect, const IntPoint& destPoint); 115 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour ceSize, const IntRect& sourceRect, const IntPoint& destPoint);
116 116
117 AffineTransform baseTransform() const { return AffineTransform(); } 117 AffineTransform baseTransform() const { return AffineTransform(); }
118 WebLayer* platformLayer() const; 118 WebLayer* platformLayer() const;
119 119
120 // FIXME: current implementations of this method have the restriction that t hey only work 120 // FIXME: current implementations of this method have the restriction that t hey only work
121 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0 , as specified in 121 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0 , as specified in
122 // Extensions3D::canUseCopyTextureCHROMIUM(). 122 // Extensions3D::canUseCopyTextureCHROMIUM().
123 // Destroys the TEXTURE_2D binding for the active texture unit of the passed context 123 // Destroys the TEXTURE_2D binding for the active texture unit of the passed context
124 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject, GLenum, GLenum, GLint, bool, bool); 124 bool copyToPlatformTexture(WebGraphicsContext3D*, GLenum, Platform3DObject, GLenum, GLenum, GLint, bool, bool);
125 bool copySubToPlatformTexture(WebGraphicsContext3D*, GLenum, Platform3DObjec t, GLint, GLint xoffset,
126 GLint yoffset, GLsizei width, GLsizei height, bool, bool);
125 127
126 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er); 128 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er);
127 129
128 void flush(); // process deferred draw commands immediately 130 void flush(); // process deferred draw commands immediately
129 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co ntext if the surface is accelerated 131 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co ntext if the surface is accelerated
130 132
131 void notifySurfaceInvalid(); 133 void notifySurfaceInvalid();
132 134
133 PassRefPtr<SkImage> newSkImageSnapshot() const; 135 PassRefPtr<SkImage> newSkImageSnapshot() const;
134 PassRefPtr<Image> newImageSnapshot() const; 136 PassRefPtr<Image> newImageSnapshot() const;
135 137
136 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 138 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
137 String debugName() const { return "ImageBuffer"; } 139 String debugName() const { return "ImageBuffer"; }
138 140
139 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode); 141 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode);
140 142
141 private: 143 private:
142 ImageBuffer(PassOwnPtr<ImageBufferSurface>); 144 ImageBuffer(PassOwnPtr<ImageBufferSurface>);
143 145
144 enum SnapshotState { 146 enum SnapshotState {
145 InitialSnapshotState, 147 InitialSnapshotState,
146 DidAcquireSnapshot, 148 DidAcquireSnapshot,
147 DrawnToAfterSnapshot, 149 DrawnToAfterSnapshot,
148 }; 150 };
149 mutable SnapshotState m_snapshotState; 151 mutable SnapshotState m_snapshotState;
152
153 bool copyToPlatformTextureInternal(bool isFullCopy, WebGraphicsContext3D*, G Lenum, Platform3DObject, GLenum, GLenum,
154 GLint, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, bool , bool);
155
150 OwnPtr<ImageBufferSurface> m_surface; 156 OwnPtr<ImageBufferSurface> m_surface;
151 ImageBufferClient* m_client; 157 ImageBufferClient* m_client;
152 }; 158 };
153 159
154 struct ImageDataBuffer { 160 struct ImageDataBuffer {
155 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { } 161 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { }
156 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const; 162 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const;
157 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double* quali ty, Vector<char>* output) const; 163 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double* quali ty, Vector<char>* output) const;
158 unsigned char* pixels() const { return m_data; } 164 unsigned char* pixels() const { return m_data; }
159 int height() const { return m_size.height(); } 165 int height() const { return m_size.height(); }
160 int width() const { return m_size.width(); } 166 int width() const { return m_size.width(); }
161 unsigned char* m_data; 167 unsigned char* m_data;
162 IntSize m_size; 168 IntSize m_size;
163 }; 169 };
164 170
165 } // namespace blink 171 } // namespace blink
166 172
167 #endif // ImageBuffer_h 173 #endif // ImageBuffer_h
OLDNEW
« no previous file with comments | « Source/modules/webgl/WebGLRenderingContextBase.cpp ('k') | Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698