| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/test/test_texture.h" | 5 #include "cc/test/test_texture.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
| 8 #include "third_party/khronos/GLES2/gl2ext.h" | 11 #include "third_party/khronos/GLES2/gl2ext.h" |
| 9 | 12 |
| 10 namespace cc { | 13 namespace cc { |
| 11 | 14 |
| 12 size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format) { | 15 size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format) { |
| 13 unsigned int components_per_pixel = 4; | 16 unsigned int components_per_pixel = 4; |
| 14 unsigned int bytes_per_component = 1; | 17 unsigned int bytes_per_component = 1; |
| 15 return size.width() * size.height() * components_per_pixel * | 18 return size.width() * size.height() * components_per_pixel * |
| 16 bytes_per_component; | 19 bytes_per_component; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 this->size = size; | 34 this->size = size; |
| 32 this->format = format; | 35 this->format = format; |
| 33 this->data.reset(new uint8_t[TextureSizeBytes(size, format)]); | 36 this->data.reset(new uint8_t[TextureSizeBytes(size, format)]); |
| 34 } | 37 } |
| 35 | 38 |
| 36 bool TestTexture::IsValidParameter(GLenum pname) { | 39 bool TestTexture::IsValidParameter(GLenum pname) { |
| 37 return params.find(pname) != params.end(); | 40 return params.find(pname) != params.end(); |
| 38 } | 41 } |
| 39 | 42 |
| 40 } // namespace cc | 43 } // namespace cc |
| OLD | NEW |