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

Commit da819e47 authored by Alec Mouri's avatar Alec Mouri
Browse files

[HWUI] Use ANativeWindow_get{Height, Width}

gui/Surface will eventually be removed since HWUI needs to depend on a
stable ABI, so use the NDK methods for querying width and height that
operates on ANativeWindow instead.

Bug: 137012798
Test: builds
Change-Id: I1309e31992190e7b44c6ea83f962f372b6b0afcf
parent 8018eeac
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -565,8 +565,8 @@ SkISize CanvasContext::getNextFrameSize() const {
    ReliableSurface* surface = mNativeSurface.get();
    ReliableSurface* surface = mNativeSurface.get();
    if (surface) {
    if (surface) {
        SkISize size;
        SkISize size;
        surface->query(NATIVE_WINDOW_WIDTH, &size.fWidth);
        size.fWidth = ANativeWindow_getWidth(surface);
        surface->query(NATIVE_WINDOW_HEIGHT, &size.fHeight);
        size.fHeight = ANativeWindow_getHeight(surface);
        return size;
        return size;
    }
    }
    return {INT32_MAX, INT32_MAX};
    return {INT32_MAX, INT32_MAX};
+2 −3
Original line number Original line Diff line number Diff line
@@ -208,9 +208,8 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaDisplayList, prepareListAndChildren_vdOffscr
    test::TestContext testContext;
    test::TestContext testContext;
    testContext.setRenderOffscreen(true);
    testContext.setRenderOffscreen(true);
    auto surface = testContext.surface();
    auto surface = testContext.surface();
    int width, height;
    int width = ANativeWindow_getWidth(surface.get());
    surface->query(NATIVE_WINDOW_WIDTH, &width);
    int height = ANativeWindow_getHeight(surface.get());
    surface->query(NATIVE_WINDOW_HEIGHT, &height);
    canvasContext->setSurface(std::move(surface));
    canvasContext->setSurface(std::move(surface));


    TreeInfo info(TreeInfo::MODE_FULL, *canvasContext.get());
    TreeInfo info(TreeInfo::MODE_FULL, *canvasContext.get());