summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2019-04-16 12:15:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-16 12:15:16 +0000
commit949305fe52816c6a51454cc8aee56fee8486eeac (patch)
tree7d8917b4823809584d316d9ab115b92e9eb1ce0d /libs/hwui/renderthread/CanvasContext.cpp
parent083190633a61edd861de7255fe43bc1570c84d25 (diff)
parent6c5864c098aa72e88cb8512255d3c01a449a372e (diff)
Merge "Do not cache AVDs that are off screen" into qt-dev
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 1b3bd302fba9..2957b143a343 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -41,6 +41,7 @@
#include <sys/stat.h>
#include <algorithm>
+#include <cstdint>
#include <cstdlib>
#include <functional>
@@ -510,6 +511,17 @@ void CanvasContext::doFrame() {
prepareAndDraw(nullptr);
}
+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);
+ return size;
+ }
+ return {INT32_MAX, INT32_MAX};
+}
+
void CanvasContext::prepareAndDraw(RenderNode* node) {
ATRACE_CALL();