Revert "Add vis of android device clip restriction, fix regular clip vis on gpu"

This reverts commit aac8e44d5c.

Reason for revert: Attempted fix didn't work, still producing red on tree.

Original change's description:
> Add vis of android device clip restriction, fix regular clip vis on gpu
> 
> Change-Id: I103025f4a9955c46f34b02d4e3ef1626796029e1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263521
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=kjlubick@google.com,nifong@google.com

Change-Id: Ia1f3a53b829ceb15467da12a104d87d7b1e7dad9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263697
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2020-01-10 17:57:21 +00:00 committed by Skia Commit-Bot
parent 1637f117aa
commit 66f7ca63b1
3 changed files with 5 additions and 31 deletions

View File

@ -157,12 +157,6 @@ class SkpDebugPlayer {
}
fLayerManager->setClipVizColor(SkColor(color));
}
void setAndroidClipViz(bool on) {
for (int i=0; i < frames.size(); i++) {
frames[i]->setAndroidClipViz(on);
}
// doesn't matter in layers
}
// The two operations below only apply to the current frame, because they concern the command
// list, which is unique to each frame.
void deleteCommand(int index) {
@ -321,7 +315,6 @@ class SkpDebugPlayer {
debugCanvas->setOverdrawViz(false);
debugCanvas->setDrawGpuOpBounds(false);
debugCanvas->setClipVizColor(SK_ColorTRANSPARENT);
debugCanvas->setAndroidClipViz(false);
frames.push_back(std::move(debugCanvas));
i++;
}
@ -454,8 +447,7 @@ EMSCRIPTEN_BINDINGS(my_module) {
.function("setCommandVisibility", &SkpDebugPlayer::setCommandVisibility)
.function("setGpuOpBounds", &SkpDebugPlayer::setGpuOpBounds)
.function("setInspectedLayer", &SkpDebugPlayer::setInspectedLayer)
.function("setOverdrawVis", &SkpDebugPlayer::setOverdrawVis)
.function("setAndroidClipViz", &SkpDebugPlayer::setAndroidClipViz);
.function("setOverdrawVis", &SkpDebugPlayer::setOverdrawVis);
// Structs used as arguments or returns to the functions above
value_object<SkIRect>("SkIRect")

View File

@ -32,7 +32,6 @@ namespace {
// Constants used in Annotations by Android for keeping track of layers
static constexpr char kOffscreenLayerDraw[] = "OffscreenLayerDraw";
static constexpr char kSurfaceID[] = "SurfaceID";
static constexpr char kAndroidClip[] = "AndroidDeviceClipRestriction";
} // namespace
class DebugPaintFilterCanvas : public SkPaintFilterCanvas {
@ -116,10 +115,6 @@ void DebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) {
DebugPaintFilterCanvas filterCanvas(originalCanvas);
SkCanvas* finalCanvas = fOverdrawViz ? &filterCanvas : originalCanvas;
if (!fAndroidClip.isEmpty()) {
finalCanvas->clipRect(fAndroidClip);
}
// If we have a GPU backend we can also visualize the op information
GrAuditTrail* at = nullptr;
if (fDrawGpuOpBounds || m != -1) {
@ -146,6 +141,10 @@ void DebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) {
if (SkColorGetA(fClipVizColor) != 0) {
finalCanvas->save();
#define LARGE_COORD 1000000000
finalCanvas->clipRect(
SkRect::MakeLTRB(-LARGE_COORD, -LARGE_COORD, LARGE_COORD, LARGE_COORD),
kReverseDifference_SkClipOp);
SkPaint clipPaint;
clipPaint.setColor(fClipVizColor);
finalCanvas->drawPaint(clipPaint);
@ -156,13 +155,6 @@ void DebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) {
fClip = finalCanvas->getDeviceClipBounds();
finalCanvas->restoreToCount(saveCount);
if (fShowAndroidClip) {
// Draw visualization of android device clip restriction
SkPaint androidClipPaint;
androidClipPaint.setARGB(80, 255, 100, 0);
finalCanvas->drawRect(fAndroidClip, androidClipPaint);
}
// draw any ops if required and issue a full reset onto GrAuditTrail
if (at) {
// just in case there is global reordering, we flush the canvas before querying
@ -343,12 +335,6 @@ void DebugCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData*
return; // don't record it
}
}
if (strcmp(kAndroidClip, key) == 0) {
// Store this frame's android device clip restriction for visualization later.
// This annotation stands in place of the androidFramework_setDeviceClipRestriction
// which is unrecordable.
fAndroidClip = rect;
}
this->addDrawCommand(new DrawAnnotationCommand(rect, key, sk_ref_sp(value)));
}

View File

@ -59,8 +59,6 @@ public:
*/
void setClipVizColor(SkColor clipVizColor) { this->fClipVizColor = clipVizColor; }
void setAndroidClipViz(bool enable) {this->fShowAndroidClip = enable; }
void setDrawGpuOpBounds(bool drawGpuOpBounds) { fDrawGpuOpBounds = drawGpuOpBounds; }
bool getDrawGpuOpBounds() const { return fDrawGpuOpBounds; }
@ -227,7 +225,6 @@ private:
bool fOverdrawViz;
SkColor fClipVizColor;
bool fDrawGpuOpBounds;
bool fShowAndroidClip;
// When not negative, indicates the render node id of the layer represented by the next
// drawPicture call.
@ -239,7 +236,6 @@ private:
// May be set when DebugCanvas is used in playing back an animation.
// Only used for passing to fLayerManager to identify itself.
int fFrame = -1;
SkRect fAndroidClip = SkRect::MakeEmpty();
/**
Adds the command to the class' vector of commands.