| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ | 5 #ifndef COMPONENTS_VIZ_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ |
| 6 #define COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ | 6 #define COMPONENTS_VIZ_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "components/display_compositor/display_compositor_export.h" | 12 #include "components/viz/display_compositor/gl_helper.h" |
| 13 #include "components/display_compositor/gl_helper.h" | 13 #include "components/viz/viz_export.h" |
| 14 | 14 |
| 15 namespace display_compositor { | 15 namespace viz { |
| 16 | 16 |
| 17 class DISPLAY_COMPOSITOR_EXPORT GLHelperReadbackSupport { | 17 class VIZ_EXPORT GLHelperReadbackSupport { |
| 18 public: | 18 public: |
| 19 enum FormatSupport { SUPPORTED, SWIZZLE, NOT_SUPPORTED }; | 19 enum FormatSupport { SUPPORTED, SWIZZLE, NOT_SUPPORTED }; |
| 20 | 20 |
| 21 GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl); | 21 explicit GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl); |
| 22 | 22 |
| 23 ~GLHelperReadbackSupport(); | 23 ~GLHelperReadbackSupport(); |
| 24 | 24 |
| 25 // For a given color type retrieve whether readback is supported and if so | 25 // For a given color type retrieve whether readback is supported and if so |
| 26 // how it should be performed. The |format|, |type| and |bytes_per_pixel| are | 26 // how it should be performed. The |format|, |type| and |bytes_per_pixel| are |
| 27 // the values that should be used with glReadPixels to facilitate the | 27 // the values that should be used with glReadPixels to facilitate the |
| 28 // readback. If |can_swizzle| is true then this method will return SWIZZLE if | 28 // readback. If |can_swizzle| is true then this method will return SWIZZLE if |
| 29 // the data needs to be swizzled before using the returned |format| otherwise | 29 // the data needs to be swizzled before using the returned |format| otherwise |
| 30 // the method will return SUPPORTED to indicate that readback is permitted of | 30 // the method will return SUPPORTED to indicate that readback is permitted of |
| 31 // this color othewise NOT_SUPPORTED will be returned. This method always | 31 // this color othewise NOT_SUPPORTED will be returned. This method always |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Avoid using this API in between texture operations, as this does some | 64 // Avoid using this API in between texture operations, as this does some |
| 65 // teture opertions (bind, attach) internally. | 65 // teture opertions (bind, attach) internally. |
| 66 bool SupportsFormat(GLenum format, GLenum type); | 66 bool SupportsFormat(GLenum format, GLenum type); |
| 67 | 67 |
| 68 FormatSupport format_support_table_[kLastEnum_SkColorType + 1]; | 68 FormatSupport format_support_table_[kLastEnum_SkColorType + 1]; |
| 69 | 69 |
| 70 gpu::gles2::GLES2Interface* gl_; | 70 gpu::gles2::GLES2Interface* gl_; |
| 71 std::vector<struct FormatCacheEntry> format_cache_; | 71 std::vector<struct FormatCacheEntry> format_cache_; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace display_compositor | 74 } // namespace viz |
| 75 | 75 |
| 76 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ | 76 #endif // COMPONENTS_VIZ_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_ |
| OLD | NEW |