FboCache.cpp revision e2d345ea67e2960b37bfdc0fc8626d1bfa747404
1/*
2 * Copyright (C) 2010 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#define LOG_TAG "OpenGLRenderer"
18
19#include "FboCache.h"
20#include "Properties.h"
21
22namespace android {
23namespace uirenderer {
24
25///////////////////////////////////////////////////////////////////////////////
26// Constructors/destructor
27///////////////////////////////////////////////////////////////////////////////
28
29FboCache::FboCache(): mMaxSize(DEFAULT_FBO_CACHE_SIZE) {
30    char property[PROPERTY_VALUE_MAX];
31    if (property_get(PROPERTY_FBO_CACHE_SIZE, property, NULL) > 0) {
32        LOGD("  Setting fbo cache size to %s", property);
33        mMaxSize = atoi(property);
34    } else {
35        LOGD("  Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE);
36    }
37}
38
39FboCache::~FboCache() {
40    clear();
41}
42
43///////////////////////////////////////////////////////////////////////////////
44// Size management
45///////////////////////////////////////////////////////////////////////////////
46
47uint32_t FboCache::getSize() {
48    return mCache.size();
49}
50
51uint32_t FboCache::getMaxSize() {
52    return mMaxSize;
53}
54
55///////////////////////////////////////////////////////////////////////////////
56// Caching
57///////////////////////////////////////////////////////////////////////////////
58
59void FboCache::clear() {
60
61}
62
63GLuint FboCache::get() {
64    return 0;
65}
66
67bool FboCache::put(GLuint fbo) {
68    return false;
69}
70
71}; // namespace uirenderer
72}; // namespace android
73