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

Side by Side Diff: cc/test/test_texture.cc

Issue 1535833002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: rebase Created 4 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 | « cc/test/test_texture.h ('k') | cc/test/test_tile_priorities.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/test/test_texture.h"
6
7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "third_party/khronos/GLES2/gl2ext.h"
9
10 namespace cc {
11
12 size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format) {
13 unsigned int components_per_pixel = 4;
14 unsigned int bytes_per_component = 1;
15 return size.width() * size.height() * components_per_pixel *
16 bytes_per_component;
17 }
18
19 TestTexture::TestTexture() : format(RGBA_8888) {
20 // Initialize default parameter values.
21 params[GL_TEXTURE_MAG_FILTER] = GL_LINEAR;
22 params[GL_TEXTURE_MIN_FILTER] = GL_NEAREST_MIPMAP_LINEAR;
23 params[GL_TEXTURE_WRAP_S] = GL_REPEAT;
24 params[GL_TEXTURE_WRAP_T] = GL_REPEAT;
25 params[GL_TEXTURE_POOL_CHROMIUM] = GL_TEXTURE_POOL_UNMANAGED_CHROMIUM;
26 params[GL_TEXTURE_USAGE_ANGLE] = GL_NONE;
27 }
28
29 TestTexture::~TestTexture() {}
30
31 void TestTexture::Reallocate(const gfx::Size& size, ResourceFormat format) {
32 this->size = size;
33 this->format = format;
34 this->data.reset(new uint8_t[TextureSizeBytes(size, format)]);
35 }
36
37 bool TestTexture::IsValidParameter(GLenum pname) {
38 return params.find(pname) != params.end();
39 }
40
41 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_texture.h ('k') | cc/test/test_tile_priorities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698