| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <sys/mman.h> | 6 #include <sys/mman.h> |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 | 10 |
| 11 #include "main.h" | 11 #include "main.h" |
| 12 #include "testbase.h" | 12 #include "testbase.h" |
| 13 #include "utils.h" | 13 #include "utils.h" |
| 14 #include "yuv2rgb.h" | 14 #include "yuv2rgb.h" |
| 15 | 15 |
| 16 namespace glbench { | 16 namespace glbench { |
| 17 | 17 |
| 18 class YuvToRgbTest : public DrawArraysTestFunc { | 18 class YuvToRgbTest : public DrawArraysTestFunc { |
| 19 public: | 19 public: |
| 20 YuvToRgbTest() { | 20 YuvToRgbTest() { |
| 21 memset(textures_, 0, sizeof(textures_)); | 21 memset(textures_, 0, sizeof(textures_)); |
| 22 } | 22 } |
| 23 virtual ~YuvToRgbTest() { | 23 virtual ~YuvToRgbTest() { |
| 24 glDeleteTextures(arraysize(textures_), textures_); | 24 glDeleteTextures(arraysize(textures_), textures_); |
| 25 } | 25 } |
| 26 virtual bool Run(); | 26 virtual bool Run(); |
| 27 virtual const char* Name() const { return "yuv_to_rgb"; } |
| 27 | 28 |
| 28 enum YuvTestFlavor { | 29 enum YuvTestFlavor { |
| 29 YUV_PLANAR_ONE_TEXTURE_SLOW, | 30 YUV_PLANAR_ONE_TEXTURE_SLOW, |
| 30 YUV_PLANAR_ONE_TEXTURE_FASTER, | 31 YUV_PLANAR_ONE_TEXTURE_FASTER, |
| 31 YUV_PLANAR_THREE_TEXTURES, | 32 YUV_PLANAR_THREE_TEXTURES, |
| 32 YUV_SEMIPLANAR_TWO_TEXTURES, | 33 YUV_SEMIPLANAR_TWO_TEXTURES, |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 GLuint textures_[6]; | 37 GLuint textures_[6]; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 return true; | 257 return true; |
| 257 } | 258 } |
| 258 | 259 |
| 259 | 260 |
| 260 TestBase* GetYuvToRgbTest() { | 261 TestBase* GetYuvToRgbTest() { |
| 261 return new YuvToRgbTest(); | 262 return new YuvToRgbTest(); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace glbench | 265 } // namespace glbench |
| OLD | NEW |