| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resource.h" | 5 #include "cc/resources/resource.h" |
| 6 #include "third_party/khronos/GLES2/gl2ext.h" | 6 #include "third_party/khronos/GLES2/gl2ext.h" |
| 7 | 7 |
| 8 namespace cc { | 8 namespace cc { |
| 9 | 9 |
| 10 void Resource::set_dimensions(const gfx::Size& size, GLenum format) { | 10 void Resource::set_dimensions(const gfx::Size& size, GLenum format) { |
| 11 size_ = size; | 11 size_ = size; |
| 12 format_ = format; | 12 format_ = format; |
| 13 } | 13 } |
| 14 | 14 |
| 15 size_t Resource::bytes() const { | 15 size_t Resource::bytes() const { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 return components_per_pixel * bytes_per_component; | 36 return components_per_pixel * bytes_per_component; |
| 37 } | 37 } |
| 38 | 38 |
| 39 size_t Resource::MemorySizeBytes(const gfx::Size& size, GLenum format) { | 39 size_t Resource::MemorySizeBytes(const gfx::Size& size, GLenum format) { |
| 40 return BytesPerPixel(format) * size.width() * size.height(); | 40 return BytesPerPixel(format) * size.width() * size.height(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 } // namespace cc | 44 } // namespace cc |
| OLD | NEW |