blob: 6661aede16f72f87cfe26786346b36481551eb89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_TEST_TEST_TEXTURE_H_
#define CC_TEST_TEST_TEXTURE_H_
#include <stddef.h>
#include <stdint.h>
#include <unordered_map>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "cc/resources/resource_format.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/geometry/size.h"
namespace cc {
size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format);
struct TestTexture : public base::RefCounted<TestTexture> {
TestTexture();
void Reallocate(const gfx::Size& size, ResourceFormat format);
bool IsValidParameter(GLenum pname);
gfx::Size size;
ResourceFormat format;
scoped_ptr<uint8_t[]> data;
using TextureParametersMap = std::unordered_map<GLenum, GLint>;
TextureParametersMap params;
private:
friend class base::RefCounted<TestTexture>;
~TestTexture();
};
} // namespace cc
#endif // CC_TEST_TEST_TEXTURE_H_
|