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

Unified Diff: cc/output/color_lut_cache.h

Issue 2648043002: Create FP16 LUTs when needed (Closed)
Patch Set: mark all floats as floats (not doubles) Created 3 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
« no previous file with comments | « no previous file | 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
index 4ea5732b89d1535c904ed0acd6480020096d8ba3..12a1db5eba5d1a360162dd6d719c79a46f453774 100644
--- a/cc/output/color_lut_cache.h
+++ b/cc/output/color_lut_cache.h
@@ -19,34 +19,39 @@ class GLES2Interface;
class ColorLUTCache {
public:
- explicit ColorLUTCache(gpu::gles2::GLES2Interface* gl);
+ explicit ColorLUTCache(gpu::gles2::GLES2Interface* gl,
+ bool texture_half_float_linear);
~ColorLUTCache();
- unsigned int GetLUT(const gfx::ColorSpace& from,
- const gfx::ColorSpace& to,
- int lut_samples);
+ struct LUT {
+ unsigned int texture;
+ int size;
+ };
+
+ LUT GetLUT(const gfx::ColorSpace& from, const gfx::ColorSpace& to);
// End of frame, assume all LUTs handed out are no longer used.
void Swap();
private:
+ template <typename T>
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;
+ typedef std::pair<gfx::ColorSpace, gfx::ColorSpace> CacheKey;
struct CacheVal {
- CacheVal(unsigned int texture, uint32_t last_used_frame)
- : texture(texture), last_used_frame(last_used_frame) {}
- unsigned int texture;
+ CacheVal(LUT lut, uint32_t last_used_frame)
+ : lut(lut), last_used_frame(last_used_frame) {}
+ LUT lut;
uint32_t last_used_frame;
};
base::MRUCache<CacheKey, CacheVal> lut_cache_;
uint32_t current_frame_;
gpu::gles2::GLES2Interface* gl_;
+ bool texture_half_float_linear_;
DISALLOW_COPY_AND_ASSIGN(ColorLUTCache);
};
« no previous file with comments | « no previous file | cc/output/color_lut_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698