PageRenderTime 27ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/libs/rs/driver/rsdProgramRaster.cpp

http://github.com/CyanogenMod/android_frameworks_base
C++ | 55 lines | 28 code | 12 blank | 15 comment | 1 complexity | 3a23a06028289a4c8ea1ea43e64924c8 MD5 | raw file
Possible License(s): LGPL-2.1, MPL-2.0-no-copyleft-exception, CC0-1.0, BitTorrent-1.0, BSD-3-Clause
 1/*
 2 * Copyright (C) 2011 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
18#include "rsdCore.h"
19#include "rsdProgramStore.h"
20
21#include "rsContext.h"
22#include "rsProgramStore.h"
23
24#include <GLES/gl.h>
25#include <GLES/glext.h>
26
27
28using namespace android;
29using namespace android::renderscript;
30
31bool rsdProgramRasterInit(const Context *, const ProgramRaster *) {
32    return true;
33}
34
35void rsdProgramRasterSetActive(const Context *rsc, const ProgramRaster *pr) {
36    switch (pr->mHal.state.cull) {
37        case RS_CULL_BACK:
38            RSD_CALL_GL(glEnable, GL_CULL_FACE);
39            RSD_CALL_GL(glCullFace, GL_BACK);
40            break;
41        case RS_CULL_FRONT:
42            RSD_CALL_GL(glEnable, GL_CULL_FACE);
43            RSD_CALL_GL(glCullFace, GL_FRONT);
44            break;
45        case RS_CULL_NONE:
46            RSD_CALL_GL(glDisable, GL_CULL_FACE);
47            break;
48    }
49
50}
51
52void rsdProgramRasterDestroy(const Context *, const ProgramRaster *) {
53}
54
55