summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
diff options
context:
space:
mode:
authorBrian Salomon <bsalomon@google.com>2020-12-21 12:59:33 -0500
committerBrian Salomon <bsalomon@google.com>2020-12-21 18:07:09 +0000
commite788aa451598bab7f632204114796104de04aed8 (patch)
tree2132011de7365270b4d796792123e78ab6e66034 /libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
parent18b99c5260e4164f25e303995eaa89e8397f1e85 (diff)
Use new method of getting top layer FBO details from SkCanvas.
This avoids having to peer through multiple layers of private Skia abstractions to get the FBO ID and size. Also use framework-only SkCanvas method to get top layer bounds. Test: Presubmit checks will test this change. Bug: skia:11019 Change-Id: I62095162e80c4837485f0f89bd40372846303309
Diffstat (limited to 'libs/hwui/pipeline/skia/GLFunctorDrawable.cpp')
-rw-r--r--libs/hwui/pipeline/skia/GLFunctorDrawable.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
index bfbdc5c009c0..c6c9e9dc869a 100644
--- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
+++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp
@@ -19,8 +19,6 @@
#include <private/hwui/DrawGlInfo.h>
#include "FunctorDrawable.h"
#include "GrBackendSurface.h"
-#include "GrRenderTarget.h"
-#include "GrRenderTargetContext.h"
#include "RenderNode.h"
#include "SkAndroidFrameworkUtils.h"
#include "SkClipStack.h"
@@ -40,19 +38,13 @@ static void setScissor(int viewportHeight, const SkIRect& clip) {
}
static void GetFboDetails(SkCanvas* canvas, GLuint* outFboID, SkISize* outFboSize) {
- GrRenderTargetContext* renderTargetContext =
- canvas->internal_private_accessTopLayerRenderTargetContext();
- LOG_ALWAYS_FATAL_IF(!renderTargetContext, "Failed to retrieve GrRenderTargetContext");
-
- GrRenderTarget* renderTarget = renderTargetContext->accessRenderTarget();
- LOG_ALWAYS_FATAL_IF(!renderTarget, "accessRenderTarget failed");
-
+ GrBackendRenderTarget renderTarget = canvas->topLayerBackendRenderTarget();
GrGLFramebufferInfo fboInfo;
- LOG_ALWAYS_FATAL_IF(!renderTarget->getBackendRenderTarget().getGLFramebufferInfo(&fboInfo),
+ LOG_ALWAYS_FATAL_IF(!renderTarget.getGLFramebufferInfo(&fboInfo),
"getGLFrameBufferInfo failed");
*outFboID = fboInfo.fFBOID;
- *outFboSize = SkISize::Make(renderTargetContext->width(), renderTargetContext->height());
+ *outFboSize = renderTarget.dimensions();
}
void GLFunctorDrawable::onDraw(SkCanvas* canvas) {
@@ -75,7 +67,7 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) {
SkISize fboSize;
GetFboDetails(canvas, &fboID, &fboSize);
- SkIRect surfaceBounds = canvas->internal_private_getTopLayerBounds();
+ SkIRect surfaceBounds = canvas->topLayerBounds();
SkIRect clipBounds = canvas->getDeviceClipBounds();
SkM44 mat4(canvas->getLocalToDevice());
SkRegion clipRegion;