blob: 706960cafe65aaeeeacfddb3f2e606be869ff5ec [file] [log] [blame]
Mathias Agopian3f844832013-08-07 21:24:32 -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>
18#include <string.h>
19
20#include <utils/TypeHelpers.h>
21
22#include <GLES2/gl2.h>
23#include <GLES2/gl2ext.h>
24
25#include "Description.h"
26
27namespace android {
28
Romain Guy88d37dd2017-05-26 17:57:05 -070029Description::Description() {
Mathias Agopianff2ed702013-09-01 21:36:12 -070030 mPremultipliedAlpha = false;
Mathias Agopian3f844832013-08-07 21:24:32 -070031 mOpaque = true;
Mathias Agopian49457ac2013-08-14 18:20:17 -070032 mTextureEnabled = false;
Mathias Agopianff2ed702013-09-01 21:36:12 -070033 mColorMatrixEnabled = false;
Mathias Agopian3f844832013-08-07 21:24:32 -070034}
35
36Description::~Description() {
37}
38
Mathias Agopian3f844832013-08-07 21:24:32 -070039void Description::setPremultipliedAlpha(bool premultipliedAlpha) {
Romain Guy88d37dd2017-05-26 17:57:05 -070040 mPremultipliedAlpha = premultipliedAlpha;
Mathias Agopian3f844832013-08-07 21:24:32 -070041}
42
43void Description::setOpaque(bool opaque) {
Romain Guy88d37dd2017-05-26 17:57:05 -070044 mOpaque = opaque;
Mathias Agopian3f844832013-08-07 21:24:32 -070045}
46
Mathias Agopian49457ac2013-08-14 18:20:17 -070047void Description::setTexture(const Texture& texture) {
48 mTexture = texture;
49 mTextureEnabled = true;
Mathias Agopian3f844832013-08-07 21:24:32 -070050}
51
52void Description::disableTexture() {
Mathias Agopian49457ac2013-08-14 18:20:17 -070053 mTextureEnabled = false;
Mathias Agopian3f844832013-08-07 21:24:32 -070054}
55
chaviw13fdc492017-06-27 12:40:18 -070056void Description::setColor(const half4& color) {
57 mColor = color;
Mathias Agopian3f844832013-08-07 21:24:32 -070058}
59
Mathias Agopiana8c386f2013-08-26 20:42:07 -070060void Description::setProjectionMatrix(const mat4& mtx) {
61 mProjectionMatrix = mtx;
Mathias Agopian3f844832013-08-07 21:24:32 -070062}
63
Mathias Agopianff2ed702013-09-01 21:36:12 -070064void Description::setColorMatrix(const mat4& mtx) {
65 const mat4 identity;
66 mColorMatrix = mtx;
67 mColorMatrixEnabled = (mtx != identity);
68}
69
Dan Stozaf0087992014-10-20 15:46:09 -070070const mat4& Description::getColorMatrix() const {
71 return mColorMatrix;
72}
73
Romain Guy88d37dd2017-05-26 17:57:05 -070074void Description::setWideGamut(bool wideGamut) {
75 mIsWideGamut = wideGamut;
76}
Mathias Agopianff2ed702013-09-01 21:36:12 -070077
Mathias Agopian3f844832013-08-07 21:24:32 -070078} /* namespace android */