| 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 "config.h" | |
| 6 | |
| 7 #include "cc/resource.h" | 5 #include "cc/resource.h" |
| 8 #include "third_party/khronos/GLES2/gl2ext.h" | 6 #include "third_party/khronos/GLES2/gl2ext.h" |
| 9 | 7 |
| 10 namespace cc { | 8 namespace cc { |
| 11 | 9 |
| 12 void Resource::setDimensions(const gfx::Size& size, GLenum format) | 10 void Resource::setDimensions(const gfx::Size& size, GLenum format) |
| 13 { | 11 { |
| 14 m_size = size; | 12 m_size = size; |
| 15 m_format = format; | 13 m_format = format; |
| 16 } | 14 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 40 } | 38 } |
| 41 return componentsPerPixel * bytesPerComponent; | 39 return componentsPerPixel * bytesPerComponent; |
| 42 } | 40 } |
| 43 | 41 |
| 44 size_t Resource::memorySizeBytes(const gfx::Size& size, GLenum format) | 42 size_t Resource::memorySizeBytes(const gfx::Size& size, GLenum format) |
| 45 { | 43 { |
| 46 return bytesPerPixel(format) * size.width() * size.height(); | 44 return bytesPerPixel(format) * size.width() * size.height(); |
| 47 } | 45 } |
| 48 | 46 |
| 49 } // namespace cc | 47 } // namespace cc |
| OLD | NEW |