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

Commit a671cf17 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add support for render-ahead""

parents c5e8e23e 1a4a9811
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,6 @@ bool Properties::showDirtyRegions = false;
bool Properties::skipEmptyFrames = true;
bool Properties::skipEmptyFrames = true;
bool Properties::useBufferAge = true;
bool Properties::useBufferAge = true;
bool Properties::enablePartialUpdates = true;
bool Properties::enablePartialUpdates = true;
bool Properties::usePresentTime = true;


DebugLevel Properties::debugLevel = kDebugDisabled;
DebugLevel Properties::debugLevel = kDebugDisabled;
OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default;
OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default;
@@ -136,7 +135,6 @@ bool Properties::load() {
    skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true);
    skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true);
    useBufferAge = property_get_bool(PROPERTY_USE_BUFFER_AGE, true);
    useBufferAge = property_get_bool(PROPERTY_USE_BUFFER_AGE, true);
    enablePartialUpdates = property_get_bool(PROPERTY_ENABLE_PARTIAL_UPDATES, true);
    enablePartialUpdates = property_get_bool(PROPERTY_ENABLE_PARTIAL_UPDATES, true);
    usePresentTime = property_get_bool(PROPERTY_USE_PRESENT_TIME, true);


    filterOutTestOverhead = property_get_bool(PROPERTY_FILTER_TEST_OVERHEAD, false);
    filterOutTestOverhead = property_get_bool(PROPERTY_FILTER_TEST_OVERHEAD, false);


+0 −7
Original line number Original line Diff line number Diff line
@@ -151,12 +151,6 @@ enum DebugLevel {
 */
 */
#define PROPERTY_ENABLE_PARTIAL_UPDATES "debug.hwui.use_partial_updates"
#define PROPERTY_ENABLE_PARTIAL_UPDATES "debug.hwui.use_partial_updates"


/**
 * Setting this to "false" will disable the use of the EGL_ANDROID_presentation_time extension
 * and prevents more precise control over swap behavior & timings.
 */
#define PROPERTY_USE_PRESENT_TIME "debug.hwui.use_present_time"

#define PROPERTY_FILTER_TEST_OVERHEAD "debug.hwui.filter_test_overhead"
#define PROPERTY_FILTER_TEST_OVERHEAD "debug.hwui.filter_test_overhead"


/**
/**
@@ -226,7 +220,6 @@ public:
    static bool skipEmptyFrames;
    static bool skipEmptyFrames;
    static bool useBufferAge;
    static bool useBufferAge;
    static bool enablePartialUpdates;
    static bool enablePartialUpdates;
    static bool usePresentTime;


    // TODO: Move somewhere else?
    // TODO: Move somewhere else?
    static constexpr float textGamma = 1.45f;
    static constexpr float textGamma = 1.45f;
+1 −25
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
#include "CanvasContext.h"
#include "CanvasContext.h"
#include <GpuMemoryTracker.h>
#include <GpuMemoryTracker.h>


#include "../Properties.h"
#include "AnimationContext.h"
#include "AnimationContext.h"
#include "Caches.h"
#include "Caches.h"
#include "EglManager.h"
#include "EglManager.h"
@@ -33,6 +32,7 @@
#include "renderstate/Stencil.h"
#include "renderstate/Stencil.h"
#include "utils/GLUtils.h"
#include "utils/GLUtils.h"
#include "utils/TimeUtils.h"
#include "utils/TimeUtils.h"
#include "../Properties.h"


#include <cutils/properties.h>
#include <cutils/properties.h>
#include <private/hwui/DrawGlInfo.h>
#include <private/hwui/DrawGlInfo.h>
@@ -159,7 +159,6 @@ void CanvasContext::setSurface(sp<Surface>&& surface) {
    if (hasSurface) {
    if (hasSurface) {
        mHaveNewSurface = true;
        mHaveNewSurface = true;
        mSwapHistory.clear();
        mSwapHistory.clear();
        updateBufferCount();
    } else {
    } else {
        mRenderThread.removeFrameCallback(this);
        mRenderThread.removeFrameCallback(this);
    }
    }
@@ -393,9 +392,6 @@ void CanvasContext::draw() {


    waitOnFences();
    waitOnFences();


    frame.setPresentTime(mCurrentFrameInfo->get(FrameInfoIndex::Vsync) +
                         (mRenderThread.timeLord().frameIntervalNanos() * (mRenderAheadDepth + 1)));

    bool requireSwap = false;
    bool requireSwap = false;
    bool didSwap =
    bool didSwap =
            mRenderPipeline->swapBuffers(frame, drew, windowDirty, mCurrentFrameInfo, &requireSwap);
            mRenderPipeline->swapBuffers(frame, drew, windowDirty, mCurrentFrameInfo, &requireSwap);
@@ -619,26 +615,6 @@ int64_t CanvasContext::getFrameNumber() {
    return mFrameNumber;
    return mFrameNumber;
}
}


void overrideBufferCount(const sp<Surface>& surface, int bufferCount) {
    struct SurfaceExposer : Surface {
        using Surface::setBufferCount;
    };
    // Protected is just a sign, not a cop
    ((*surface.get()).*&SurfaceExposer::setBufferCount)(bufferCount);
}

void CanvasContext::updateBufferCount() {
    overrideBufferCount(mNativeSurface, 3 + mRenderAheadDepth);
}

void CanvasContext::setRenderAheadDepth(int renderAhead) {
    if (renderAhead < 0 || renderAhead > 2 || renderAhead == mRenderAheadDepth) {
        return;
    }
    mRenderAheadDepth = renderAhead;
    updateBufferCount();
}

SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) {
SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) {
    if (frame.width() != mLastFrameWidth || frame.height() != mLastFrameHeight) {
    if (frame.width() != mLastFrameWidth || frame.height() != mLastFrameHeight) {
        // can't rely on prior content of window if viewport size changes
        // can't rely on prior content of window if viewport size changes
+1 −5
Original line number Original line Diff line number Diff line
@@ -188,8 +188,6 @@ public:


    IRenderPipeline* getRenderPipeline() { return mRenderPipeline.get(); }
    IRenderPipeline* getRenderPipeline() { return mRenderPipeline.get(); }


    void setRenderAheadDepth(int renderAhead);

private:
private:
    CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode,
    CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode,
                  IContextFactory* contextFactory, std::unique_ptr<IRenderPipeline> renderPipeline);
                  IContextFactory* contextFactory, std::unique_ptr<IRenderPipeline> renderPipeline);
@@ -202,7 +200,6 @@ private:
    void freePrefetchedLayers();
    void freePrefetchedLayers();


    bool isSwapChainStuffed();
    bool isSwapChainStuffed();
    void updateBufferCount();


    SkRect computeDirtyRect(const Frame& frame, SkRect* dirty);
    SkRect computeDirtyRect(const Frame& frame, SkRect* dirty);


@@ -228,7 +225,6 @@ private:


    RingBuffer<SwapHistory, 3> mSwapHistory;
    RingBuffer<SwapHistory, 3> mSwapHistory;
    int64_t mFrameNumber = -1;
    int64_t mFrameNumber = -1;
    int mRenderAheadDepth = 0;


    // last vsync for a dropped frame due to stuffed queue
    // last vsync for a dropped frame due to stuffed queue
    nsecs_t mLastDropVsync = 0;
    nsecs_t mLastDropVsync = 0;
+3 −2
Original line number Original line Diff line number Diff line
@@ -103,8 +103,9 @@ void DrawFrameTask::run() {


    // Even if we aren't drawing this vsync pulse the next frame number will still be accurate
    // Even if we aren't drawing this vsync pulse the next frame number will still be accurate
    if (CC_UNLIKELY(callback)) {
    if (CC_UNLIKELY(callback)) {
        context->enqueueFrameWork(
        context->enqueueFrameWork([callback, frameNr = context->getFrameNumber()]() {
                [ callback, frameNr = context->getFrameNumber() ]() { callback(frameNr); });
            callback(frameNr);
        });
    }
    }


    if (CC_LIKELY(canDrawThisFrame)) {
    if (CC_LIKELY(canDrawThisFrame)) {
Loading