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

Commit 5693b244 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Delete all ro.hwui.* props"

parents 7934ae85 8dc02f99
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -50,9 +50,9 @@ Caches* Caches::sInstance = nullptr;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


Caches::Caches(RenderState& renderState)
Caches::Caches(RenderState& renderState)
        : gradientCache(mExtensions)
        : gradientCache(extensions())
        , patchCache(renderState)
        , patchCache(renderState)
        , programCache(mExtensions)
        , programCache(extensions())
        , mRenderState(&renderState)
        , mRenderState(&renderState)
        , mInitialized(false) {
        , mInitialized(false) {
    INIT_LOGD("Creating OpenGL renderer caches");
    INIT_LOGD("Creating OpenGL renderer caches");
@@ -80,7 +80,7 @@ bool Caches::init() {
}
}


void Caches::initExtensions() {
void Caches::initExtensions() {
    if (mExtensions.hasDebugMarker()) {
    if (extensions().hasDebugMarker()) {
        eventMark = glInsertEventMarkerEXT;
        eventMark = glInsertEventMarkerEXT;


        startMark = glPushGroupMarkerEXT;
        startMark = glPushGroupMarkerEXT;
@@ -93,12 +93,12 @@ void Caches::initExtensions() {
}
}


void Caches::initConstraints() {
void Caches::initConstraints() {
    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
    maxTextureSize = DeviceInfo::get()->maxTextureSize();
}
}


void Caches::initStaticProperties() {
void Caches::initStaticProperties() {
    // OpenGL ES 3.0+ specific features
    // OpenGL ES 3.0+ specific features
    gpuPixelBuffersEnabled = mExtensions.hasPixelBufferObjects()
    gpuPixelBuffersEnabled = extensions().hasPixelBufferObjects()
            && property_get_bool(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, true);
            && property_get_bool(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, true);
}
}


+2 −5
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


#pragma once
#pragma once


#include "DeviceInfo.h"
#include "Extensions.h"
#include "Extensions.h"
#include "FboCache.h"
#include "FboCache.h"
#include "GammaFontRenderer.h"
#include "GammaFontRenderer.h"
@@ -145,10 +146,6 @@ public:
    // Misc
    // Misc
    GLint maxTextureSize;
    GLint maxTextureSize;


private:
    // Declared before gradientCache and programCache which need this to initialize.
    // TODO: cleanup / move elsewhere
    Extensions mExtensions;
public:
public:
    TextureCache textureCache;
    TextureCache textureCache;
    RenderBufferCache renderBufferCache;
    RenderBufferCache renderBufferCache;
@@ -174,7 +171,7 @@ public:
    void setProgram(const ProgramDescription& description);
    void setProgram(const ProgramDescription& description);
    void setProgram(Program* program);
    void setProgram(Program* program);


    const Extensions& extensions() const { return mExtensions; }
    const Extensions& extensions() const { return DeviceInfo::get()->extensions(); }
    Program& program() { return *mProgram; }
    Program& program() { return *mProgram; }
    PixelBufferState& pixelBufferState() { return *mPixelBufferState; }
    PixelBufferState& pixelBufferState() { return *mPixelBufferState; }
    TextureState& textureState() { return *mTextureState; }
    TextureState& textureState() { return *mTextureState; }
+11 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,8 @@


#include <DeviceInfo.h>
#include <DeviceInfo.h>


#include "Extensions.h"
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>


#include <thread>
#include <thread>
#include <mutex>
#include <mutex>
@@ -46,13 +47,22 @@ void DeviceInfo::initialize() {
void DeviceInfo::initialize(int maxTextureSize) {
void DeviceInfo::initialize(int maxTextureSize) {
    std::call_once(sInitializedFlag, [maxTextureSize]() {
    std::call_once(sInitializedFlag, [maxTextureSize]() {
        sDeviceInfo = new DeviceInfo();
        sDeviceInfo = new DeviceInfo();
        sDeviceInfo->loadDisplayInfo();
        sDeviceInfo->mMaxTextureSize = maxTextureSize;
        sDeviceInfo->mMaxTextureSize = maxTextureSize;
    });
    });
}
}


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


void DeviceInfo::loadDisplayInfo() {
    sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay(
            ISurfaceComposer::eDisplayIdMain));
    status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &mDisplayInfo);
    LOG_ALWAYS_FATAL_IF(status, "Failed to get display info, error %d", status);
}

} /* namespace uirenderer */
} /* namespace uirenderer */
} /* namespace android */
} /* namespace android */
+13 −0
Original line number Original line Diff line number Diff line
@@ -16,7 +16,10 @@
#ifndef DEVICEINFO_H
#ifndef DEVICEINFO_H
#define DEVICEINFO_H
#define DEVICEINFO_H


#include <ui/DisplayInfo.h>

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


namespace android {
namespace android {
namespace uirenderer {
namespace uirenderer {
@@ -35,14 +38,24 @@ public:
    static void initialize(int maxTextureSize);
    static void initialize(int maxTextureSize);


    int maxTextureSize() const { return mMaxTextureSize; }
    int maxTextureSize() const { return mMaxTextureSize; }
    const DisplayInfo& displayInfo() const { return mDisplayInfo; }
    const Extensions& extensions() const { return mExtensions; }

    static uint32_t multiplyByResolution(uint32_t in) {
        auto di = DeviceInfo::get()->displayInfo();
        return di.w * di.h * in;
    }


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


    void load();
    void load();
    void loadDisplayInfo();


    int mMaxTextureSize;
    int mMaxTextureSize;
    DisplayInfo mDisplayInfo;
    Extensions mExtensions;
};
};


} /* namespace uirenderer */
} /* namespace uirenderer */
+1 −1
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


FboCache::FboCache()
FboCache::FboCache()
        : mMaxSize(Properties::fboCacheSize) {}
        : mMaxSize(0) {}


FboCache::~FboCache() {
FboCache::~FboCache() {
    clear();
    clear();
Loading