14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file.
44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
50f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#ifndef CC_TEST_TEST_TEXTURE_H_
60f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#define CC_TEST_TEST_TEXTURE_H_
70f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "base/containers/hash_tables.h"
94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "base/memory/ref_counted.h"
104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "base/memory/scoped_ptr.h"
114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "cc/resources/resource_format.h"
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "third_party/khronos/GLES2/gl2.h"
130f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#include "ui/gfx/size.h"
144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace cc {
164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format);
184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
190f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)struct TestTexture : public base::RefCounted<TestTexture> {
204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  TestTexture();
214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void Reallocate(const gfx::Size& size, ResourceFormat format);
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  bool IsValidParameter(GLenum pname);
244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  gfx::Size size;
264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  ResourceFormat format;
274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  scoped_ptr<uint8_t[]> data;
284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  typedef base::hash_map<GLenum, GLint>
30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)      TextureParametersMap;
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  TextureParametersMap params;
324e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
334e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) private:
344e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  friend class base::RefCounted<TestTexture>;
354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)  ~TestTexture();
364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)};
374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
384e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}  // namespace cc
394e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
400f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#endif  // CC_TEST_TEST_TEXTURE_H_
41