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

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

Merge "SkRect::MakeLargest is deprecated, so create our own"

parents e4df2564 f3338bda
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#pragma once

#include "SkiaUtils.h"

#include <SkCanvas.h>
#include <SkDrawable.h>
#include <SkMatrix.h>
@@ -89,7 +91,7 @@ protected:
    virtual SkRect onGetBounds() override {
        // We don't want to enable a record time quick reject because the properties
        // of the RenderNode may be updated on subsequent frames.
        return SkRect::MakeLargest();
        return SkRectMakeLargest();
    }
    /**
     * This function draws into a canvas as forceDraw, but does nothing if the render node has a
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#pragma once

#include "RenderNodeDrawable.h"
#include "SkiaUtils.h"

#include <SkCanvas.h>
#include <SkDrawable.h>
@@ -41,7 +42,7 @@ public:
    explicit StartReorderBarrierDrawable(SkiaDisplayList* data);

protected:
    virtual SkRect onGetBounds() override { return SkRect::MakeLargest(); }
    virtual SkRect onGetBounds() override { return SkRectMakeLargest(); }
    virtual void onDraw(SkCanvas* canvas) override;

private:
@@ -65,7 +66,7 @@ public:
    explicit EndReorderBarrierDrawable(StartReorderBarrierDrawable* startBarrier);

protected:
    virtual SkRect onGetBounds() override { return SkRect::MakeLargest(); }
    virtual SkRect onGetBounds() override { return SkRectMakeLargest(); }
    virtual void onDraw(SkCanvas* canvas) override;

private:
+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

#pragma once

#include <SkRect.h>

namespace android {

static inline SkRect SkRectMakeLargest() {
    const SkScalar v = SK_ScalarMax;
    return { -v, -v, v, v };
};

} /* namespace android */
+5 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "DamageAccumulator.h"
#include "IContextFactory.h"
#include "SkiaCanvas.h"
#include "pipeline/skia/SkiaUtils.h"
#include "pipeline/skia/SkiaDisplayList.h"
#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/SkiaRecordingCanvas.h"
@@ -41,7 +42,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrame) {
                redCanvas.drawColor(SK_ColorRED, SkBlendMode::kSrcOver);
            });
    LayerUpdateQueue layerUpdateQueue;
    SkRect dirty = SkRect::MakeLargest();
    SkRect dirty = SkRectMakeLargest();
    std::vector<sp<RenderNode>> renderNodes;
    renderNodes.push_back(redNode);
    bool opaque = true;
@@ -62,7 +63,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, testOnPrepareTree) {
            });

    LayerUpdateQueue layerUpdateQueue;
    SkRect dirty = SkRect::MakeLargest();
    SkRect dirty = SkRectMakeLargest();
    std::vector<sp<RenderNode>> renderNodes;
    renderNodes.push_back(redNode);
    bool opaque = true;
@@ -97,7 +98,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderFrameCheckOpaque) {
                bottomHalfGreenCanvas.drawRect(0, 1, 2, 2, greenPaint);
            });
    LayerUpdateQueue layerUpdateQueue;
    SkRect dirty = SkRect::MakeLargest();
    SkRect dirty = SkRectMakeLargest();
    std::vector<sp<RenderNode>> renderNodes;
    renderNodes.push_back(halfGreenNode);
    android::uirenderer::Rect contentDrawBounds(0, 0, 2, 2);
@@ -160,7 +161,7 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaPipeline, renderLayer) {

    // attach both layers to the update queue
    LayerUpdateQueue layerUpdateQueue;
    SkRect dirty = SkRect::MakeLargest();
    SkRect dirty = SkRectMakeLargest();
    layerUpdateQueue.enqueueLayerWithDamage(redNode.get(), dirty);
    layerUpdateQueue.enqueueLayerWithDamage(blueNode.get(), SkRect::MakeWH(2, 1));
    ASSERT_EQ(layerUpdateQueue.entries().size(), 2UL);