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

Commit c0f50362 authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android (Google) Code Review
Browse files

Merge changes If99865cd,I5b794c94

* changes:
  Fix test breakage due to naming collision in the linker.
  Minor cleanup of unused headers and overly described functions.
parents 890eb4c6 5ef78a89
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ Canvas* Picture::beginRecording(int width, int height) {
    mRecorder.reset(new SkPictureRecorder);
    mWidth = width;
    mHeight = height;
    SkCanvas* canvas = mRecorder->beginRecording(width, height, NULL, 0);
    SkCanvas* canvas = mRecorder->beginRecording(SkIntToScalar(width), SkIntToScalar(height));
    return Canvas::create_canvas(canvas);
}

+0 −2
Original line number Diff line number Diff line
@@ -19,11 +19,9 @@

#include "AnimationContext.h"
#include "Caches.h"
#include "DeferredLayerUpdater.h"
#include "EglManager.h"
#include "LayerUpdateQueue.h"
#include "Properties.h"
#include "Readback.h"
#include "RenderThread.h"
#include "hwui/Canvas.h"
#include "renderstate/RenderState.h"
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ RENDERTHREAD_TEST(CanvasContext, create) {
    canvasContext->destroy(nullptr);
}

// This must be in an anonymous namespace as this class name is used in multiple
// cpp files for different purposes and without the namespace the linker can
// arbitrarily choose which class to link against.
namespace {
class TestFunctor : public Functor {
public:
    bool didProcess = false;
@@ -52,6 +56,7 @@ public:
        return DrawGlInfo::kStatusDone;
    }
};
}; // end anonymous namespace

RENDERTHREAD_TEST(CanvasContext, invokeFunctor) {
    TestFunctor functor;
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ TEST(SkiaCanvasProxy, drawGlyphsViaPicture) {
        SkCanvas* skCanvas = recorder.beginRecording(200, 200, NULL, 0);
        std::unique_ptr<Canvas> pictCanvas(Canvas::create_canvas(skCanvas));
        TestUtils::drawUtf8ToCanvas(pictCanvas.get(), text, paint, 25, 25);
        sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
        sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();

        canvas.asSkCanvas()->drawPicture(picture);
    });
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,10 @@ TEST(SkiaDisplayList, reuseDisplayList) {
    ASSERT_EQ(availableList.get(), nullptr);
}

// This must be in an anonymous namespace as this class name is used in multiple
// cpp files for different purposes and without the namespace the linker can
// arbitrarily choose which class to link against.
namespace {
class TestFunctor : public Functor {
public:
    bool didSync = false;
@@ -100,6 +104,7 @@ public:
        return DrawGlInfo::kStatusDone;
    }
};
}; // end anonymous namespace

TEST(SkiaDisplayList, syncContexts) {
    SkRect bounds = SkRect::MakeWH(200, 200);