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

Unified Diff: cc/output/color_lut_cache.h

Issue 2088273003: Video Color Managament (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: log color space Created 4 years, 4 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/layers/video_layer_impl.cc ('k') | cc/output/color_lut_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/color_lut_cache.h
diff --git a/cc/output/color_lut_cache.h b/cc/output/color_lut_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d5effc9e4e8f9e397de5b56f9b747e6531bcca0
--- /dev/null
+++ b/cc/output/color_lut_cache.h
@@ -0,0 +1,45 @@
+// 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_COLOR_LUT_CACHE_H_
+#define CC_OUTPUT_COLOR_LUT_CACHE_H_
+
+#include <map>
+
+#include "base/containers/mru_cache.h"
+#include "base/macros.h"
+#include "ui/gfx/color_space.h"
+
+namespace gpu {
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
+class ColorLUTCache {
+ public:
+ explicit ColorLUTCache(gpu::gles2::GLES2Interface* gl);
+ ~ColorLUTCache();
+
+ unsigned int GetLUT(const gfx::ColorSpace& from,
+ const gfx::ColorSpace& to,
+ int lut_samples);
+
+ // End of frame, assume all LUTs handed out are no longer used.
+ void Swap();
+
+ private:
+ unsigned int MakeLUT(const gfx::ColorSpace& from,
+ gfx::ColorSpace to,
+ int lut_samples);
+ typedef std::pair<gfx::ColorSpace, std::pair<gfx::ColorSpace, size_t>>
+ CacheKey;
+
+ base::MRUCache<CacheKey, std::pair<unsigned int, size_t>> lut_cache_;
+ uint32_t current_frame_;
+ gpu::gles2::GLES2Interface* gl_;
+ DISALLOW_COPY_AND_ASSIGN(ColorLUTCache);
+};
+
+#endif // CC_OUTPUT_COLOR_LUT_CACHE_H_
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/output/color_lut_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698