blob: e161c44e5c20fae199fe61b3a572a04bc210ecc5 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
Mathias Agopian67016af2012-02-02 15:14:13 -08002 * Copyright (C) 2012 The Android Open Source Project
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08003 *
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
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080017#include <errno.h>
18#include <stdlib.h>
19#include <stdio.h>
20#include <string.h>
21
22#include <unistd.h>
23#include <fcntl.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080024
25#include <utils/Log.h>
26
27#include "DisplayHardware/DisplayHardwareBase.h"
28#include "SurfaceFlinger.h"
29
30// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080031namespace android {
32
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080033DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger,
34 uint32_t displayIndex)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080035{
Mathias Agopianb60314a2012-04-10 22:09:54 -070036 mScreenAcquired = true;
Mathias Agopianf6de1c02012-02-05 02:15:28 -080037}
38
Mathias Agopian67016af2012-02-02 15:14:13 -080039DisplayHardwareBase::~DisplayHardwareBase() {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080040}
41
Mathias Agopian67016af2012-02-02 15:14:13 -080042bool DisplayHardwareBase::canDraw() const {
Mathias Agopianf7cdd052011-10-10 22:18:55 -070043 return mScreenAcquired;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080044}
45
Mathias Agopian67016af2012-02-02 15:14:13 -080046void DisplayHardwareBase::releaseScreen() const {
Mathias Agopianb60314a2012-04-10 22:09:54 -070047 mScreenAcquired = false;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080048}
49
Mathias Agopian67016af2012-02-02 15:14:13 -080050void DisplayHardwareBase::acquireScreen() const {
51 mScreenAcquired = true;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080052}
53
Mathias Agopian67016af2012-02-02 15:14:13 -080054bool DisplayHardwareBase::isScreenAcquired() const {
Mathias Agopian59119e62010-10-11 12:37:43 -070055 return mScreenAcquired;
56}
57
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080058}; // namespace android