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

Unified Diff: cc/output/buffer_to_texture_target_map.h

Issue 2120713002: Fix use_image_texture_target inconsistencies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix content browsertests Created 4 years, 5 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 | « cc/cc_tests.gyp ('k') | cc/output/buffer_to_texture_target_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/buffer_to_texture_target_map.h
diff --git a/cc/output/buffer_to_texture_target_map.h b/cc/output/buffer_to_texture_target_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..62ea52fd853ef43d2f98843d7c88525caf2f0d33
--- /dev/null
+++ b/cc/output/buffer_to_texture_target_map.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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 CC_OUTPUT_BUFFER_TO_TEXTURE_TARGET_MAP_H_
+#define CC_OUTPUT_BUFFER_TO_TEXTURE_TARGET_MAP_H_
+
+#include <map>
+#include <string>
+
+#include "cc/base/cc_export.h"
+#include "ui/gfx/buffer_types.h"
+
+namespace cc {
+// A map of GPU Memory Buffer usage/format to GL texture target.
+using BufferToTextureTargetKey = std::pair<gfx::BufferUsage, gfx::BufferFormat>;
+using BufferToTextureTargetMap = std::map<BufferToTextureTargetKey, uint32_t>;
+
+// Converts a serialized ImageTextureTargetsMap back to the runtime format.
+// Serialization takes the form:
+// "usage,format,target;usage,format,target;...;usage,format,target"
+CC_EXPORT BufferToTextureTargetMap
+StringToBufferToTextureTargetMap(const std::string& str);
+
+// Converts an ImageTextureTargetsMap to a string representation of the format:
+// "usage,format,target;usage,format,target;...;usage,format,target"
+CC_EXPORT std::string BufferToTextureTargetMapToString(
+ const BufferToTextureTargetMap& map);
+
+// Returns a default-initialized BufferToTextureTargetsMap where every entry
+// maps to GL_TEXTURE_2D.
+CC_EXPORT BufferToTextureTargetMap DefaultBufferToTextureTargetMapForTesting();
+
+} // namespace cc
+
+#endif // CC_OUTPUT_BUFFER_TO_TEXTURE_TARGET_MAP_H_
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/buffer_to_texture_target_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698