1// Copyright (c) 2012 The Chromium OS 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#ifndef BENCH_GL_TEXTURETEST_H_
6#define BENCH_GL_TEXTURETEST_H_
7
8#include <memory>
9
10#include "testbase.h"
11#include "utils.h"
12
13namespace glbench {
14
15namespace {
16
17const int kNumberOfTextures = 8;
18
19}  // namespace
20
21class TextureTest : public TestBase {
22 public:
23  TextureTest() {}
24  virtual ~TextureTest() {}
25  virtual bool TestFunc(uint64_t iterations) = 0;
26  virtual bool Run();
27  virtual const char* Name() const = 0;
28  virtual const char* Unit() const { return "mtexel_sec"; }
29
30  enum UpdateFlavor {
31    TEX_IMAGE,
32    TEX_SUBIMAGE
33  };
34
35 protected:
36  GLuint width_;
37  GLuint height_;
38  GLuint program_;
39  int texsize_;
40  std::unique_ptr<char[]> pixels_[kNumberOfTextures];
41  GLuint textures_[kNumberOfTextures];
42  UpdateFlavor flavor_;
43  GLenum texel_gl_format_;
44  DISALLOW_COPY_AND_ASSIGN(TextureTest);
45};
46
47} // namespace glbench
48
49#endif  // BENCH_GL_TEXTURETEST_H_
50