Revert "Add new SkCanvas methods for Android Framework WebView queries."

This reverts commit 14a25eff99.

Reason for revert: breaking android roll.

Original change's description:
> Add new SkCanvas methods for Android Framework WebView queries.
>
> Existing queries will be deleted after Android framework update.
>
> This puts the queries behind SK_BUILD_FOR_ANDROID_FRAMEWORK and
> removes the need for the framework to hop through multiple levels
> of abstraction to get to the FBO info.
>
> Change-Id: Ia016b0d3044c803603e36bc1c5e1a644f50a7eaf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343417
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com,stani@google.com

Change-Id: I40ac3b7eec101c246cc41a40d930b9a03ece3264
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343519
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2020-12-11 20:24:58 +00:00 committed by Skia Commit-Bot
parent 06e9e5dde3
commit f760258654
2 changed files with 3 additions and 33 deletions

View File

@ -35,7 +35,6 @@
// Working on allow this to be undefined
#define SK_SUPPORT_LEGACY_GETTOTALMATRIX
class GrBackendRenderTarget;
class GrRecordingContext;
class GrSurfaceDrawContext;
class SkBaseDevice;
@ -2459,13 +2458,7 @@ public:
// don't call
virtual GrSurfaceDrawContext* internal_private_accessTopLayerRenderTargetContext();
SkIRect internal_private_getTopLayerBounds() const { return this->internalGetTopLayerBounds(); }
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
// These methods exist to support WebView in Android Framework.
SkIRect topLayerBounds() const { return this->internalGetTopLayerBounds(); }
GrBackendRenderTarget topLayerBackendRenderTarget() const;
#endif
SkIRect internal_private_getTopLayerBounds() const { return getTopLayerBounds(); }
// TEMP helpers until we switch virtual over to const& for src-rect
void legacy_drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
@ -2693,7 +2686,7 @@ private:
* Gets the bounds of the top level layer in global canvas coordinates. We don't want this
* to be public because it exposes decisions about layer sizes that are internal to the canvas.
*/
SkIRect internalGetTopLayerBounds() const;
SkIRect getTopLayerBounds() const;
// All base onDrawX() functions should call this and skip drawing if it returns true.
// If 'matrix' is non-null, it maps the paint's fast bounds before checking for quick rejection

View File

@ -547,7 +547,7 @@ SkISize SkCanvas::getBaseLayerSize() const {
return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0);
}
SkIRect SkCanvas::internalGetTopLayerBounds() const {
SkIRect SkCanvas::getTopLayerBounds() const {
SkBaseDevice* d = this->getTopDevice();
if (!d) {
return SkIRect::MakeEmpty();
@ -1716,29 +1716,6 @@ GrSurfaceDrawContext* SkCanvas::internal_private_accessTopLayerRenderTargetConte
return dev ? dev->accessRenderTargetContext() : nullptr;
}
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
static_assert(SK_SUPPORT_GPU);
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrRenderTargetProxy.h"
#include "src/gpu/GrSurfaceDrawContext.h"
GrBackendRenderTarget SkCanvas::topLayerBackendRenderTarget() const {
SkBaseDevice* dev = this->getTopDevice();
if (!dev) {
return {};
}
GrSurfaceDrawContext* sdc = dev->accessRenderTargetContext();
if (!sdc) {
return {};
}
GrRenderTargetProxy* proxy = sdc->asRenderTargetProxy();
SkASSERT(proxy);
GrRenderTarget* renderTarget = proxy->peekRenderTarget();
return renderTarget ? renderTarget->getBackendRenderTarget() : GrBackendRenderTarget();
}
#endif
GrRecordingContext* SkCanvas::recordingContext() {
SkBaseDevice* device = this->getTopDevice();
return device ? device->recordingContext() : nullptr;