• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 #include "SimpleBenchmark.h"
8 
9 struct TexSubImageParams : public BenchmarkParams
10 {
11     int imageWidth;
12     int imageHeight;
13     int subImageWidth;
14     int subImageHeight;
15     unsigned int iterations;
16 
17     virtual std::string name() const;
18 };
19 
20 class TexSubImageBenchmark : public SimpleBenchmark
21 {
22   public:
23     TexSubImageBenchmark(const TexSubImageParams &params);
24 
25     virtual bool initializeBenchmark();
26     virtual void destroyBenchmark();
27     virtual void beginDrawBenchmark();
28     virtual void drawBenchmark();
29 
30   private:
31     GLuint createTexture();
32 
33     TexSubImageParams mParams;
34 
35     // Handle to a program object
36     GLuint mProgram;
37 
38     // Attribute locations
39     GLint mPositionLoc;
40     GLint mTexCoordLoc;
41 
42     // Sampler location
43     GLint mSamplerLoc;
44 
45     // Texture handle
46     GLuint mTexture;
47 
48     // Buffer handle
49     GLuint mVertexBuffer;
50     GLuint mIndexBuffer;
51 
52     GLubyte *mPixels;
53 };
54