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

Unified Diff: content/common/gpu/client/gl_helper_readback_support.h

Issue 149123008: Implement GLHelperReadbackSupport for GLHelper usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused gl_helper member. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gl_helper_readback_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gl_helper_readback_support.h
diff --git a/content/common/gpu/client/gl_helper_readback_support.h b/content/common/gpu/client/gl_helper_readback_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..f74bd18a2735f8c9768751b256dbb734a147db4c
--- /dev/null
+++ b/content/common/gpu/client/gl_helper_readback_support.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_READBACK_SUPPORT_H_
+#define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_READBACK_SUPPORT_H_
+
+#include "content/common/gpu/client/gl_helper.h"
+
+namespace content {
+
+class CONTENT_EXPORT GLHelperReadbackSupport {
+ public:
+ GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl);
+
+ ~GLHelperReadbackSupport();
+
+ // Checks whether the readback (Color read format and type) is supported
+ // for the requested texture format by the hardware or not.
+ // For ex: some hardwares have rgb565 readback
+ // support when binded with the frame buffer for others it may fail.
+ // Here we pass the internal textureformat as skia config.
+ bool IsReadbackConfigSupported(SkBitmap::Config texture_format);
+
+ private:
+ enum FormatSupport { FORMAT_NOT_SUPPORTED = 0, FORMAT_SUPPORTED, };
+
+ // This populates the format_support_table with the list of supported
+ // formats.
+ void InitializeReadbackSupport();
+
+ // This api is called once per format and it is done in the
+ // InitializeReadbackSupport. We should not use this any where
+ // except the InitializeReadbackSupport.Calling this at other places
+ // can distrub the state of normal gl operations.
+ void CheckForReadbackSupport(SkBitmap::Config texture_format);
+
+ // Helper functions for checking the supported texture formats.
+ // Avoid using this API in between texture operations, as this does some
+ // teture opertions (bind, attach) internally.
+ bool SupportsFormat(GLint format, GLint type);
+
+ FormatSupport format_support_table_[SkBitmap::kConfigCount];
+
+ gpu::gles2::GLES2Interface* gl_;
+
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_READBACK_SUPPORT_H_
« no previous file with comments | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gl_helper_readback_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698