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

Side by Side Diff: cc/output/color_lut_cache.cc

Issue 2238243002: IWYU: ffloor(3) needs <cmath>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/color_lut_cache.h" 5 #include "cc/output/color_lut_cache.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <cmath>
8 #include <vector> 9 #include <vector>
9 10
10 #include "gpu/command_buffer/client/gles2_interface.h" 11 #include "gpu/command_buffer/client/gles2_interface.h"
11 #include "ui/gfx/color_transform.h" 12 #include "ui/gfx/color_transform.h"
12 13
13 // After a LUT has not been used for this many frames, we release it. 14 // After a LUT has not been used for this many frames, we release it.
14 const uint32_t kMaxFramesUnused = 10; 15 const uint32_t kMaxFramesUnused = 10;
15 16
16 ColorLUTCache::ColorLUTCache(gpu::gles2::GLES2Interface* gl) 17 ColorLUTCache::ColorLUTCache(gpu::gles2::GLES2Interface* gl)
17 : lut_cache_(0), gl_(gl) {} 18 : lut_cache_(0), gl_(gl) {}
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 void ColorLUTCache::Swap() { 101 void ColorLUTCache::Swap() {
101 current_frame_++; 102 current_frame_++;
102 while (!lut_cache_.empty() && 103 while (!lut_cache_.empty() &&
103 current_frame_ - lut_cache_.rbegin()->second.first > 104 current_frame_ - lut_cache_.rbegin()->second.first >
104 kMaxFramesUnused) { 105 kMaxFramesUnused) {
105 gl_->DeleteTextures(1, &lut_cache_.rbegin()->second.first); 106 gl_->DeleteTextures(1, &lut_cache_.rbegin()->second.first);
106 lut_cache_.ShrinkToSize(lut_cache_.size() - 1); 107 lut_cache_.ShrinkToSize(lut_cache_.size() - 1);
107 } 108 }
108 } 109 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698