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

Side by Side Diff: content/common/gpu/client/gl_helper.h

Issue 12892005: Implement client side PBOs for glReadPixel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make GLHelper constructor explicit Created 7 years, 8 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 12 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Rect; 15 class Rect;
16 class Size; 16 class Size;
17 } 17 }
18 18
19 class SkRegion; 19 class SkRegion;
20 20
21 namespace content { 21 namespace content {
22 22
23 // Provides higher level operations on top of the WebKit::WebGraphicsContext3D 23 // Provides higher level operations on top of the WebKit::WebGraphicsContext3D
24 // interfaces. 24 // interfaces.
25 class GLHelper { 25 class GLHelper {
26 public: 26 public:
27 GLHelper(WebKit::WebGraphicsContext3D* context, 27 explicit GLHelper(WebGraphicsContext3DCommandBufferImpl* context);
28 WebKit::WebGraphicsContext3D* context_for_thread);
29 virtual ~GLHelper(); 28 virtual ~GLHelper();
30 29
31 WebKit::WebGraphicsContext3D* context() const; 30 WebGraphicsContext3DCommandBufferImpl* context() const;
32 31
33 // Copies the block of pixels specified with |src_subrect| from |src_texture|, 32 // Copies the block of pixels specified with |src_subrect| from |src_texture|,
34 // scales it to |dst_size|, and writes it into |out|. 33 // scales it to |dst_size|, and writes it into |out|.
35 // |src_size| is the size of |src_texture|. The result is of format GL_BGRA 34 // |src_size| is the size of |src_texture|. The result is of format GL_BGRA
36 // and is potentially flipped vertically to make it a correct image 35 // and is potentially flipped vertically to make it a correct image
37 // representation. |callback| is invoked with the copy result when the copy 36 // representation. |callback| is invoked with the copy result when the copy
38 // operation has completed. 37 // operation has completed.
39 void CropScaleReadbackAndCleanTexture( 38 void CropScaleReadbackAndCleanTexture(
40 WebKit::WebGLId src_texture, 39 WebKit::WebGLId src_texture,
41 const gfx::Size& src_size, 40 const gfx::Size& src_size,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 WebKit::WebGLId previous_texture, 73 WebKit::WebGLId previous_texture,
75 const SkRegion& new_damage, 74 const SkRegion& new_damage,
76 const SkRegion& old_damage); 75 const SkRegion& old_damage);
77 76
78 private: 77 private:
79 class CopyTextureToImpl; 78 class CopyTextureToImpl;
80 79
81 // Creates |copy_texture_to_impl_| if NULL. 80 // Creates |copy_texture_to_impl_| if NULL.
82 void InitCopyTextToImpl(); 81 void InitCopyTextToImpl();
83 82
84 WebKit::WebGraphicsContext3D* context_; 83 WebGraphicsContext3DCommandBufferImpl* context_;
85 WebKit::WebGraphicsContext3D* context_for_thread_;
86 scoped_ptr<CopyTextureToImpl> copy_texture_to_impl_; 84 scoped_ptr<CopyTextureToImpl> copy_texture_to_impl_;
87 85
88 // The number of all GLHelper instances.
89 static base::subtle::Atomic32 count_;
90
91 DISALLOW_COPY_AND_ASSIGN(GLHelper); 86 DISALLOW_COPY_AND_ASSIGN(GLHelper);
92 }; 87 };
93 88
94 } // namespace content 89 } // namespace content
95 90
96 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ 91 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/image_transport_factory_android.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698