summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Lubick <kjlubick@google.com> 2023-06-12 17:00:43 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-06-12 17:00:43 +0000
commit9408001b62b3805cc2f9e7b4868babfb35027be8 (patch)
tree75c6a80063d354c15715c200b0bc11d45a99725a
parentf35a4095b58ed11fca783c213077cbc921f90238 (diff)
parent6949746b2d46641ce576795e37e4d80d9e7f0946 (diff)
Merge "Use SkCanvasAndroid functions instead of deprecated canvasMethods"
-rw-r--r--libs/hwui/pipeline/skia/GLFunctorDrawable.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
index ff7c89a468de..d7ac501b9c91 100644
--- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
+++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
@@ -21,6 +21,8 @@
#include "GrBackendSurface.h"
#include "RenderNode.h"
#include "SkAndroidFrameworkUtils.h"
+#include "SkCanvas.h"
+#include "SkCanvasAndroid.h"
#include "SkClipStack.h"
#include "SkRect.h"
#include "SkM44.h"
@@ -35,7 +37,7 @@ namespace uirenderer {
namespace skiapipeline {
static void setScissor(int viewportHeight, const SkIRect& clip) {
- SkASSERT(!clip.isEmpty());
+ LOG_FATAL_IF(clip.isEmpty(), "empty scissor clip");
// transform to Y-flipped GL space, and prevent negatives
GLint y = viewportHeight - clip.fBottom;
GLint height = (viewportHeight - clip.fTop) - y;
@@ -43,7 +45,7 @@ static void setScissor(int viewportHeight, const SkIRect& clip) {
}
static void GetFboDetails(SkCanvas* canvas, GLuint* outFboID, SkISize* outFboSize) {
- GrBackendRenderTarget renderTarget = canvas->topLayerBackendRenderTarget();
+ GrBackendRenderTarget renderTarget = skgpu::ganesh::TopLayerBackendRenderTarget(canvas);
GrGLFramebufferInfo fboInfo;
LOG_ALWAYS_FATAL_IF(!renderTarget.getGLFramebufferInfo(&fboInfo),
"getGLFrameBufferInfo failed");
@@ -83,7 +85,7 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) {
SkISize fboSize;
GetFboDetails(canvas, &fboID, &fboSize);
- SkIRect surfaceBounds = canvas->topLayerBounds();
+ SkIRect surfaceBounds = skgpu::ganesh::TopLayerBounds(canvas);
SkIRect clipBounds = canvas->getDeviceClipBounds();
SkM44 mat4(canvas->getLocalToDevice());
SkRegion clipRegion;