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

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

Issue 2632533003: Use skia for transform ... but it didnt work (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | 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 <cmath>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 for (int y = 0; y < lut_samples; y++) { 64 for (int y = 0; y < lut_samples; y++) {
65 *(lutp++) = FloatToLUT(samples[y].x()); 65 *(lutp++) = FloatToLUT(samples[y].x());
66 *(lutp++) = FloatToLUT(samples[y].y()); 66 *(lutp++) = FloatToLUT(samples[y].y());
67 *(lutp++) = FloatToLUT(samples[y].z()); 67 *(lutp++) = FloatToLUT(samples[y].z());
68 *(lutp++) = 255; // alpha 68 *(lutp++) = 255; // alpha
69 } 69 }
70 } 70 }
71 } 71 }
72 72
73 unsigned int lut_texture; 73 unsigned int lut_texture;
74 // gl_->GenTextures(1, &lut_texture);
75 // gl_->BindTexture(GL_TEXTURE_3D, lut_texture);
74 gl_->GenTextures(1, &lut_texture); 76 gl_->GenTextures(1, &lut_texture);
75 gl_->BindTexture(GL_TEXTURE_2D, lut_texture); 77 gl_->BindTexture(GL_TEXTURE_2D, lut_texture);
76 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 78 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
77 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 79 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
78 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 80 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
79 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 81 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
80 gl_->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, lut_samples, 82 gl_->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, lut_samples,
81 lut_samples * lut_samples, 0, GL_RGBA, GL_UNSIGNED_BYTE, 83 lut_samples * lut_samples, 0, GL_RGBA, GL_UNSIGNED_BYTE,
82 lut.data()); 84 lut.data());
83 return lut_texture; 85 return lut_texture;
(...skipping 16 matching lines...) Expand all
100 102
101 void ColorLUTCache::Swap() { 103 void ColorLUTCache::Swap() {
102 current_frame_++; 104 current_frame_++;
103 while (!lut_cache_.empty() && 105 while (!lut_cache_.empty() &&
104 current_frame_ - lut_cache_.rbegin()->second.last_used_frame > 106 current_frame_ - lut_cache_.rbegin()->second.last_used_frame >
105 kMaxFramesUnused) { 107 kMaxFramesUnused) {
106 gl_->DeleteTextures(1, &lut_cache_.rbegin()->second.texture); 108 gl_->DeleteTextures(1, &lut_cache_.rbegin()->second.texture);
107 lut_cache_.ShrinkToSize(lut_cache_.size() - 1); 109 lut_cache_.ShrinkToSize(lut_cache_.size() - 1);
108 } 110 }
109 } 111 }
OLDNEW
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698