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

Unified Diff: components/display_compositor/gl_helper_readback_support.h

Issue 2873243002: Move components/display_compositor to components/viz/display_compositor (Closed)
Patch Set: Rebase Created 3 years, 7 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: components/display_compositor/gl_helper_readback_support.h
diff --git a/components/display_compositor/gl_helper_readback_support.h b/components/display_compositor/gl_helper_readback_support.h
deleted file mode 100644
index 039a2b6bec35b9411384f4562fe19dcdc5feb60d..0000000000000000000000000000000000000000
--- a/components/display_compositor/gl_helper_readback_support.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 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 COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_
-#define COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_
-
-#include <stddef.h>
-
-#include <vector>
-
-#include "components/display_compositor/display_compositor_export.h"
-#include "components/display_compositor/gl_helper.h"
-
-namespace display_compositor {
-
-class DISPLAY_COMPOSITOR_EXPORT GLHelperReadbackSupport {
- public:
- enum FormatSupport { SUPPORTED, SWIZZLE, NOT_SUPPORTED };
-
- GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl);
-
- ~GLHelperReadbackSupport();
-
- // For a given color type retrieve whether readback is supported and if so
- // how it should be performed. The |format|, |type| and |bytes_per_pixel| are
- // the values that should be used with glReadPixels to facilitate the
- // readback. If |can_swizzle| is true then this method will return SWIZZLE if
- // the data needs to be swizzled before using the returned |format| otherwise
- // the method will return SUPPORTED to indicate that readback is permitted of
- // this color othewise NOT_SUPPORTED will be returned. This method always
- // overwrites the out values irrespective of the return value.
- FormatSupport GetReadbackConfig(SkColorType color_type,
- bool can_swizzle,
- GLenum* format,
- GLenum* type,
- size_t* bytes_per_pixel);
- // Provides the additional readback format/type pairing for a render target
- // of a given format/type pairing
- void GetAdditionalFormat(GLenum format,
- GLenum type,
- GLenum* format_out,
- GLenum* type_out);
-
- private:
- struct FormatCacheEntry {
- GLenum format;
- GLenum type;
- GLenum read_format;
- GLenum read_type;
- };
-
- // 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(SkColorType 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(GLenum format, GLenum type);
-
- FormatSupport format_support_table_[kLastEnum_SkColorType + 1];
-
- gpu::gles2::GLES2Interface* gl_;
- std::vector<struct FormatCacheEntry> format_cache_;
-};
-
-} // namespace display_compositor
-
-#endif // COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_READBACK_SUPPORT_H_
« no previous file with comments | « components/display_compositor/gl_helper_benchmark.cc ('k') | components/display_compositor/gl_helper_readback_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698