[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
This commit is contained in:
Alec Mouri
2019-10-25 16:18:16 -07:00
parent 8018eeace2
commit da819e47f1
2 changed files with 4 additions and 5 deletions

View File

@@ -565,8 +565,8 @@ SkISize CanvasContext::getNextFrameSize() const {
ReliableSurface* surface = mNativeSurface.get();
if (surface) {
SkISize size;
surface->query(NATIVE_WINDOW_WIDTH, &size.fWidth);
surface->query(NATIVE_WINDOW_HEIGHT, &size.fHeight);
size.fWidth = ANativeWindow_getWidth(surface);
size.fHeight = ANativeWindow_getHeight(surface);
return size;
}
return {INT32_MAX, INT32_MAX};

View File

@@ -208,9 +208,8 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(SkiaDisplayList, prepareListAndChildren_vdOffscr
test::TestContext testContext;
testContext.setRenderOffscreen(true);
auto surface = testContext.surface();
int width, height;
surface->query(NATIVE_WINDOW_WIDTH, &width);
surface->query(NATIVE_WINDOW_HEIGHT, &height);
int width = ANativeWindow_getWidth(surface.get());
int height = ANativeWindow_getHeight(surface.get());
canvasContext->setSurface(std::move(surface));
TreeInfo info(TreeInfo::MODE_FULL, *canvasContext.get());