blob: 8cf85fc7f958bde8270c0060b34fa8faf69ffab1 [file] [log] [blame]
Mathias Agopian49457ac2013-08-14 18:20:17 -07001/*
2 * Copyright 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <stdint.h>
Mathias Agopiana8c386f2013-08-26 20:42:07 -070018#include <ui/mat4.h>
Mathias Agopian49457ac2013-08-14 18:20:17 -070019
20#ifndef SF_RENDER_ENGINE_TEXTURE_H
21#define SF_RENDER_ENGINE_TEXTURE_H
22
23namespace android {
24
25class Texture {
26 uint32_t mTextureName;
27 uint32_t mTextureTarget;
28 size_t mWidth;
29 size_t mHeight;
30 bool mFiltering;
Mathias Agopiana8c386f2013-08-26 20:42:07 -070031 mat4 mTextureMatrix;
Mathias Agopian49457ac2013-08-14 18:20:17 -070032
33public:
34 enum Target { TEXTURE_2D = 0x0DE1, TEXTURE_EXTERNAL = 0x8D65 };
35
36 Texture();
37 Texture(Target textureTarget, uint32_t textureName);
38 ~Texture();
39
40 void init(Target textureTarget, uint32_t textureName);
41
42 void setMatrix(float const* matrix);
43 void setFiltering(bool enabled);
44 void setDimensions(size_t width, size_t height);
45
46 uint32_t getTextureName() const;
47 uint32_t getTextureTarget() const;
48
Mathias Agopiana8c386f2013-08-26 20:42:07 -070049 const mat4& getMatrix() const;
Mathias Agopian49457ac2013-08-14 18:20:17 -070050 bool getFiltering() const;
51 size_t getWidth() const;
52 size_t getHeight() const;
53};
54
55} /* namespace android */
56#endif /* SF_RENDER_ENGINE_TEXTURE_H */