Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09689555 authored by John Reck's avatar John Reck
Browse files

Revert "add DeviceInfo"

This reverts commit b2442896.

Change-Id: I50f6555451f71067505245333c8e558b5e3b2b3b
parent b2442896
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ hwui_src_files := \
    DamageAccumulator.cpp \
    DeferredDisplayList.cpp \
    DeferredLayerUpdater.cpp \
    DeviceInfo.cpp \
    DisplayList.cpp \
    DisplayListCanvas.cpp \
    Dither.cpp \
@@ -205,7 +204,6 @@ LOCAL_SRC_FILES += \
    unit_tests/CanvasStateTests.cpp \
    unit_tests/ClipAreaTests.cpp \
    unit_tests/DamageAccumulatorTests.cpp \
    unit_tests/DeviceInfoTests.cpp \
    unit_tests/FatVectorTests.cpp \
    unit_tests/LayerUpdateQueueTests.cpp \
    unit_tests/LinearAllocatorTests.cpp \

libs/hwui/DeviceInfo.cpp

deleted100644 → 0
+0 −48
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <DeviceInfo.h>

#include "Extensions.h"

#include <GLES2/gl2.h>

#include <thread>
#include <mutex>

namespace android {
namespace uirenderer {

static DeviceInfo* sDeviceInfo = nullptr;
static std::once_flag sInitializedFlag;

const DeviceInfo* DeviceInfo::get() {
    return sDeviceInfo;
}

void DeviceInfo::initialize() {
    std::call_once(sInitializedFlag, []() {
        sDeviceInfo = new DeviceInfo();
        sDeviceInfo->load();
    });
}

void DeviceInfo::load() {
    mExtensions.load();
    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
}

} /* namespace uirenderer */
} /* namespace android */

libs/hwui/DeviceInfo.h

deleted100644 → 0
+0 −54
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef DEVICEINFO_H
#define DEVICEINFO_H

#include "Extensions.h"
#include "utils/Macros.h"

namespace android {
namespace uirenderer {

class DeviceInfo {
    PREVENT_COPY_AND_ASSIGN(DeviceInfo);
public:
    // returns nullptr if DeviceInfo is not initialized yet
    // Note this does not have a memory fence so it's up to the caller
    // to use one if required. Normally this should not be necessary
    static const DeviceInfo* get();

    // only call this after GL has been initialized, or at any point if compiled
    // with HWUI_NULL_GPU
    static void initialize();

    const Extensions& extensions() const { return mExtensions; }

    int maxTextureSize() const { return mMaxTextureSize; }

private:
    DeviceInfo() {}
    ~DeviceInfo() {}

    void load();

    Extensions mExtensions;
    int mMaxTextureSize;
};

} /* namespace uirenderer */
} /* namespace android */

#endif /* DEVICEINFO_H */
+2 −2
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ namespace uirenderer {
#endif


void Extensions::load() {
    auto extensions = StringUtils::split((const char*) glGetString(GL_EXTENSIONS));
Extensions::Extensions() {
    StringCollection extensions((const char*) glGetString(GL_EXTENSIONS));
    mHasNPot = extensions.has("GL_OES_texture_npot");
    mHasFramebufferFetch = extensions.has("GL_NV_shader_framebuffer_fetch");
    mHasDiscardFramebuffer = extensions.has("GL_EXT_discard_framebuffer");
+2 −5
Original line number Diff line number Diff line
@@ -19,9 +19,6 @@

#include <cutils/compiler.h>

#include <string>
#include <unordered_set>

namespace android {
namespace uirenderer {

@@ -29,9 +26,9 @@ namespace uirenderer {
// Classes
///////////////////////////////////////////////////////////////////////////////

class Extensions {
class ANDROID_API Extensions {
public:
    void load();
    Extensions();

    inline bool hasNPot() const { return mHasNPot; }
    inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
Loading