OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 TextureCopier_h | 5 #ifndef TextureCopier_h |
6 #define TextureCopier_h | 6 #define TextureCopier_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "GraphicsContext3D.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
| 10 #include "IntSize.h" |
10 #include "ProgramBinding.h" | 11 #include "ProgramBinding.h" |
11 #include "ShaderChromium.h" | 12 #include "ShaderChromium.h" |
12 #include <wtf/OwnPtr.h> | 13 #include <wtf/OwnPtr.h> |
13 #include <wtf/PassOwnPtr.h> | 14 #include <wtf/PassOwnPtr.h> |
14 | 15 |
15 namespace WebKit { | 16 namespace WebKit { |
16 class WebGraphicsContext3D; | 17 class WebGraphicsContext3D; |
17 } | 18 } |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 class IntSize; | |
21 | 21 |
22 class TextureCopier { | 22 class TextureCopier { |
23 public: | 23 public: |
24 struct Parameters { | 24 struct Parameters { |
25 unsigned sourceTexture; | 25 unsigned sourceTexture; |
26 unsigned destTexture; | 26 unsigned destTexture; |
27 IntSize size; | 27 IntSize size; |
28 }; | 28 }; |
29 // Copy the base level contents of |sourceTexture| to |destTexture|. Both te
xture objects | 29 // Copy the base level contents of |sourceTexture| to |destTexture|. Both te
xture objects |
30 // must be complete and have a base level of |size| dimensions. The color fo
rmats do not need | 30 // must be complete and have a base level of |size| dimensions. The color fo
rmats do not need |
(...skipping 15 matching lines...) Expand all Loading... |
46 virtual void copyTexture(Parameters) OVERRIDE; | 46 virtual void copyTexture(Parameters) OVERRIDE; |
47 virtual void flush() OVERRIDE; | 47 virtual void flush() OVERRIDE; |
48 | 48 |
49 protected: | 49 protected: |
50 AcceleratedTextureCopier(WebKit::WebGraphicsContext3D*, bool usingBindUnifor
ms); | 50 AcceleratedTextureCopier(WebKit::WebGraphicsContext3D*, bool usingBindUnifor
ms); |
51 | 51 |
52 private: | 52 private: |
53 typedef ProgramBinding<VertexShaderPosTexIdentity, FragmentShaderRGBATex> Bl
itProgram; | 53 typedef ProgramBinding<VertexShaderPosTexIdentity, FragmentShaderRGBATex> Bl
itProgram; |
54 | 54 |
55 WebKit::WebGraphicsContext3D* m_context; | 55 WebKit::WebGraphicsContext3D* m_context; |
56 Platform3DObject m_fbo; | 56 GLuint m_fbo; |
57 Platform3DObject m_positionBuffer; | 57 GLuint m_positionBuffer; |
58 OwnPtr<BlitProgram> m_blitProgram; | 58 OwnPtr<BlitProgram> m_blitProgram; |
59 bool m_usingBindUniforms; | 59 bool m_usingBindUniforms; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(AcceleratedTextureCopier); | 61 DISALLOW_COPY_AND_ASSIGN(AcceleratedTextureCopier); |
62 }; | 62 }; |
63 | 63 |
64 } | 64 } |
65 | 65 |
66 #endif | 66 #endif |
OLD | NEW |