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

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

Issue 88033002: Add RGB565 Texture readback support in gl_helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to ToT! Created 6 years, 11 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
Index: content/common/gpu/client/gl_helper.h
diff --git a/content/common/gpu/client/gl_helper.h b/content/common/gpu/client/gl_helper.h
index 90e9b7198e1cf2e2f42f51884643f38847b37c8b..396de7fa10b49001f21ad41efcf26f142de52501 100644
--- a/content/common/gpu/client/gl_helper.h
+++ b/content/common/gpu/client/gl_helper.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "third_party/skia/include/core/SkBitmap.h"
namespace gfx {
class Rect;
@@ -181,6 +182,7 @@ class CONTENT_EXPORT GLHelper {
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
unsigned char* out,
+ bool readback_config_rgb565,
const base::Callback<void(bool)>& callback);
// Copies the block of pixels specified with |src_subrect| from |src_mailbox|,
@@ -199,6 +201,7 @@ class CONTENT_EXPORT GLHelper {
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
unsigned char* out,
+ bool readback_config_rgb565,
const base::Callback<void(bool)>& callback);
// Copies the texture data out of |texture| into |out|. |size| is the
@@ -208,7 +211,8 @@ class CONTENT_EXPORT GLHelper {
// current OpenGL context.
void ReadbackTextureSync(GLuint texture,
const gfx::Rect& src_rect,
- unsigned char* out);
+ unsigned char* out,
+ SkBitmap::Config format);
// Creates a copy of the specified texture. |size| is the size of the texture.
// Note that the src_texture will have the min/mag filter set to GL_LINEAR
@@ -266,6 +270,9 @@ class CONTENT_EXPORT GLHelper {
// size of the framebuffer.
void CopyTextureFullImage(GLuint texture, const gfx::Size& size);
+ // Check whether rgb565 readback is supported or not.
+ bool CanUseRgb565Readback();
+
// A scaler will cache all intermediate textures and programs
// needed to scale from a specified size to a destination size.
// If the source or destination sizes changes, you must create
@@ -326,6 +333,8 @@ class CONTENT_EXPORT GLHelper {
gpu::ContextSupport* context_support_;
scoped_ptr<CopyTextureToImpl> copy_texture_to_impl_;
scoped_ptr<GLHelperScaling> scaler_impl_;
+ bool initialized_565_format_check_;
+ bool support_565_format_;
DISALLOW_COPY_AND_ASSIGN(GLHelper);
};
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698