| 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 CC_OUTPUT_TEXTURE_COPIER_H_ | 5 #ifndef CC_OUTPUT_TEXTURE_COPIER_H_ |
| 6 #define CC_OUTPUT_TEXTURE_COPIER_H_ | 6 #define CC_OUTPUT_TEXTURE_COPIER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 virtual void CopyTexture(Parameters parameters) = 0; | 31 virtual void CopyTexture(Parameters parameters) = 0; |
| 32 virtual void Flush() = 0; | 32 virtual void Flush() = 0; |
| 33 | 33 |
| 34 virtual ~TextureCopier() {} | 34 virtual ~TextureCopier() {} |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 class CC_EXPORT AcceleratedTextureCopier : public TextureCopier { | 37 class CC_EXPORT AcceleratedTextureCopier : public TextureCopier { |
| 38 public: | 38 public: |
| 39 static scoped_ptr<AcceleratedTextureCopier> Create( | 39 static scoped_ptr<AcceleratedTextureCopier> Create( |
| 40 WebKit::WebGraphicsContext3D* context, | 40 WebKit::WebGraphicsContext3D* context, |
| 41 bool using_bind_uniforms) { | 41 bool using_bind_uniforms, |
| 42 int highp_threshold_min) { |
| 42 return make_scoped_ptr( | 43 return make_scoped_ptr( |
| 43 new AcceleratedTextureCopier(context, using_bind_uniforms)); | 44 new AcceleratedTextureCopier( |
| 45 context, using_bind_uniforms, highp_threshold_min)); |
| 44 } | 46 } |
| 45 virtual ~AcceleratedTextureCopier(); | 47 virtual ~AcceleratedTextureCopier(); |
| 46 | 48 |
| 47 virtual void CopyTexture(Parameters parameters) OVERRIDE; | 49 virtual void CopyTexture(Parameters parameters) OVERRIDE; |
| 48 virtual void Flush() OVERRIDE; | 50 virtual void Flush() OVERRIDE; |
| 49 | 51 |
| 50 protected: | 52 protected: |
| 51 AcceleratedTextureCopier(WebKit::WebGraphicsContext3D* context, | 53 AcceleratedTextureCopier(WebKit::WebGraphicsContext3D* context, |
| 52 bool using_bind_uniforms); | 54 bool using_bind_uniforms, |
| 55 int highp_threshold_min); |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 typedef ProgramBinding<VertexShaderPosTexIdentity, FragmentShaderRGBATex> | 58 typedef ProgramBinding<VertexShaderPosTexIdentity, FragmentShaderRGBATex> |
| 56 BlitProgram; | 59 BlitProgram; |
| 57 | 60 |
| 58 WebKit::WebGraphicsContext3D* context_; | 61 WebKit::WebGraphicsContext3D* context_; |
| 59 GLuint fbo_; | 62 GLuint fbo_; |
| 60 GLuint position_buffer_; | 63 GLuint position_buffer_; |
| 61 scoped_ptr<BlitProgram> blit_program_; | 64 scoped_ptr<BlitProgram> blit_program_; |
| 65 scoped_ptr<BlitProgram> blit_program_highp_; |
| 62 bool using_bind_uniforms_; | 66 bool using_bind_uniforms_; |
| 67 int highp_threshold_min_; |
| 63 | 68 |
| 64 DISALLOW_COPY_AND_ASSIGN(AcceleratedTextureCopier); | 69 DISALLOW_COPY_AND_ASSIGN(AcceleratedTextureCopier); |
| 65 }; | 70 }; |
| 66 | 71 |
| 67 } // namespace cc | 72 } // namespace cc |
| 68 | 73 |
| 69 #endif // CC_OUTPUT_TEXTURE_COPIER_H_ | 74 #endif // CC_OUTPUT_TEXTURE_COPIER_H_ |
| OLD | NEW |