Roll external/skia 35cc6d7e3..acb056eb7 (13 commits)
https://skia.googlesource.com/skia.git/+log/35cc6d7e3..acb056eb7
2018-12-18 bsalomon@google.com Remove unused macro GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
2018-12-18 recipe-roller@chromium.org Roll recipe dependencies (trivial).
2018-12-18 herb@google.com Use SkFont for managing distance field text
2018-12-18 bsalomon@google.com Remove window rects flag from GrInternalSurfaceFlags.
2018-12-18 reed@google.com add regression test for stale fLastMoveToIndex
2018-12-18 reed@google.com force balanced save/restore after calling a GM
2018-12-18 jvanverth@google.com Add new GM to verify Plots marked correctly during regenerate.
2018-12-18 skia-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/externals/angle2 0d218da49519..720ca449767c (1 commits)
2018-12-18 herb@google.com Revert "Use SkFont in the ARGBFallback code"
2018-12-18 mtklein@google.com fold _utils.h into _matrixProcs.cpp
2018-12-18 egdaniel@google.com Pass in clip bounds when creating a GpuDrawHandler for SkDrawable.
2018-12-18 robertphillips@google.com Fix recording multiple DDLs from a single DDL Recorder (take 2)
2018-12-18 bsalomon@google.com Check for null renderer string when checking ANGLE GL info
The AutoRoll server is located here: https://autoroll-internal.skia.org/r/android-master-autoroll
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.
Test: Presubmit checks will test this change.
Exempt-From-Owner-Approval: The autoroll bot does not require owner approval.
Bug: 118850208
Change-Id: If49f071753fe1aa6890005e80e85f4757bbd79d9
diff --git a/Android.bp b/Android.bp
index 6556e56..5b95adc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1213,6 +1213,7 @@
"gm/flippity.cpp",
"gm/fontcache.cpp",
"gm/fontmgr.cpp",
+ "gm/fontregen.cpp",
"gm/fontscaler.cpp",
"gm/fontscalerdistortable.cpp",
"gm/fwidth_squircle.cpp",
@@ -2150,6 +2151,7 @@
"gm/flippity.cpp",
"gm/fontcache.cpp",
"gm/fontmgr.cpp",
+ "gm/fontregen.cpp",
"gm/fontscaler.cpp",
"gm/fontscalerdistortable.cpp",
"gm/fwidth_squircle.cpp",
diff --git a/DEPS b/DEPS
index 5e16355..93129f7 100644
--- a/DEPS
+++ b/DEPS
@@ -7,7 +7,7 @@
deps = {
"buildtools" : "https://chromium.googlesource.com/chromium/buildtools.git@505de88083136eefd056e5ee4ca0f01fe9b33de8",
"common" : "https://skia.googlesource.com/common.git@9737551d7a52c3db3262db5856e6bcd62c462b92",
- "third_party/externals/angle2" : "https://chromium.googlesource.com/angle/angle.git@0d218da495198e61334391c4a257fed54405386c",
+ "third_party/externals/angle2" : "https://chromium.googlesource.com/angle/angle.git@720ca449767c38f48bebfc6a8c5821e43176c26d",
"third_party/externals/dng_sdk" : "https://android.googlesource.com/platform/external/dng_sdk.git@96443b262250c390b0caefbf3eed8463ba35ecae",
"third_party/externals/egl-registry" : "https://skia.googlesource.com/external/github.com/KhronosGroup/EGL-Registry@a0bca08de07c7d7651047bedc0b653cfaaa4f2ae",
"third_party/externals/expat" : "https://android.googlesource.com/platform/external/expat.git@android-6.0.1_r55",
diff --git a/gm/fontcache.cpp b/gm/fontcache.cpp
index 44732ab..9fedec2 100644
--- a/gm/fontcache.cpp
+++ b/gm/fontcache.cpp
@@ -68,7 +68,6 @@
return;
}
- canvas->clear(SK_ColorLTGRAY);
this->drawText(canvas);
// Debugging tool for GPU.
static const bool kShowAtlas = false;
diff --git a/gm/fontregen.cpp b/gm/fontregen.cpp
new file mode 100644
index 0000000..3d7dbee
--- /dev/null
+++ b/gm/fontregen.cpp
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// GM to stress TextBlob regeneration and the GPU font cache
+// It's not necessary to run this with CPU configs
+//
+// The point here is to draw a set of text that will fit in one Plot, and then some large
+// text. After a flush we draw the first set of text again with a slightly different color,
+// and then enough new large text to spill the entire atlas. What *should* happen is that
+// the Plot with the first set of text will not get overwritten by the new large text.
+
+#include "gm.h"
+
+#include "GrContext.h"
+#include "GrContextPriv.h"
+#include "GrContextOptions.h"
+#include "SkCanvas.h"
+#include "SkGraphics.h"
+#include "SkImage.h"
+#include "SkTypeface.h"
+#include "gm.h"
+
+#include "sk_tool_utils.h"
+
+static sk_sp<SkTextBlob> make_blob(const SkString& text, const SkFont& font) {
+ size_t len = text.size();
+ SkAutoTArray<SkScalar> pos(len);
+ SkAutoTArray<SkGlyphID> glyphs(len);
+
+ font.textToGlyphs(text.c_str(), len, SkTextEncoding::kUTF8, glyphs.get(), len);
+ font.getXPos(glyphs.get(), len, pos.get());
+ return SkTextBlob::MakeFromPosTextH(text.c_str(), len, pos.get(), 0, font);
+}
+
+class FontRegenGM : public skiagm::GM {
+public:
+ FontRegenGM() {
+ this->setBGColor(SK_ColorLTGRAY);
+ }
+
+ void modifyGrContextOptions(GrContextOptions* options) override {
+ options->fGlyphCacheTextureMaximumBytes = 0;
+ options->fAllowMultipleGlyphCacheTextures = GrContextOptions::Enable::kNo;
+ }
+
+protected:
+ SkString onShortName() override {
+ SkString name("fontregen");
+ return name;
+ }
+
+ SkISize onISize() override { return SkISize::Make(kSize, kSize); }
+
+ void onOnceBeforeDraw() override {
+ auto tf = sk_tool_utils::create_portable_typeface("sans-serif", SkFontStyle::Normal());
+
+ static const SkString kTexts[] = {
+ SkString("abcdefghijklmnopqrstuvwxyz"),
+ SkString("ABCDEFGHI"),
+ SkString("NOPQRSTUV")
+ };
+
+ SkFont font;
+ font.setEdging(SkFont::Edging::kAntiAlias);
+ font.setSubpixel(false);
+ font.setSize(80);
+ font.setTypeface(tf);
+
+ fBlobs[0] = make_blob(kTexts[0], font);
+ font.setSize(162);
+ fBlobs[1] = make_blob(kTexts[1], font);
+ fBlobs[2] = make_blob(kTexts[2], font);
+ }
+
+ void onDraw(SkCanvas* canvas) override {
+ GrRenderTargetContext* renderTargetContext =
+ canvas->internal_private_accessTopLayerRenderTargetContext();
+ if (!renderTargetContext) {
+ skiagm::GM::DrawGpuOnlyMessage(canvas);
+ return;
+ }
+
+ SkPaint paint;
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawTextBlob(fBlobs[0], 10, 80, paint);
+ canvas->drawTextBlob(fBlobs[1], 10, 225, paint);
+ canvas->flush();
+
+ paint.setColor(0xFF010101);
+ canvas->drawTextBlob(fBlobs[0], 10, 305, paint);
+ canvas->drawTextBlob(fBlobs[2], 10, 465, paint);
+
+ // Debugging tool for GPU.
+ static const bool kShowAtlas = false;
+ if (kShowAtlas) {
+ if (auto ctx = canvas->getGrContext()) {
+ auto img = ctx->contextPriv().getFontAtlasImage_ForTesting(kA8_GrMaskFormat);
+ canvas->drawImage(img, 200, 0);
+ }
+ }
+ }
+
+private:
+ static constexpr SkScalar kSize = 512;
+
+ sk_sp<SkTextBlob> fBlobs[3];
+ typedef GM INHERITED;
+};
+
+constexpr SkScalar FontRegenGM::kSize;
+
+//////////////////////////////////////////////////////////////////////////////
+
+DEF_GM(return new FontRegenGM())
diff --git a/gm/gm.cpp b/gm/gm.cpp
index a4b8f02..a9cc3bc 100644
--- a/gm/gm.cpp
+++ b/gm/gm.cpp
@@ -32,6 +32,7 @@
fHaveCalledOnceBeforeDraw = true;
this->onOnceBeforeDraw();
}
+ SkAutoCanvasRestore acr(canvas, true);
this->onDraw(canvas);
}
@@ -41,6 +42,7 @@
fHaveCalledOnceBeforeDraw = true;
this->onOnceBeforeDraw();
}
+ SkAutoCanvasRestore acr(canvas, true);
this->onDrawBackground(canvas);
}
diff --git a/gn/core.gni b/gn/core.gni
index 0c29e5e..757b2f9 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -33,7 +33,6 @@
"$_src/core/SkBitmapProcState.cpp",
"$_src/core/SkBitmapProcState.h",
"$_src/core/SkBitmapProcState_matrixProcs.cpp",
- "$_src/core/SkBitmapProcState_utils.h",
"$_src/core/SkBitmapProvider.cpp",
"$_src/core/SkBitmapProvider.h",
"$_src/core/SkBlendMode.cpp",
diff --git a/gn/gm.gni b/gn/gm.gni
index 95ab27b..157b548 100644
--- a/gn/gm.gni
+++ b/gn/gm.gni
@@ -151,6 +151,7 @@
"$_gm/flippity.cpp",
"$_gm/fontcache.cpp",
"$_gm/fontmgr.cpp",
+ "$_gm/fontregen.cpp",
"$_gm/fontscaler.cpp",
"$_gm/fontscalerdistortable.cpp",
"$_gm/fwidth_squircle.cpp",
diff --git a/include/core/SkDrawable.h b/include/core/SkDrawable.h
index 48cca6d..3210ef7 100644
--- a/include/core/SkDrawable.h
+++ b/include/core/SkDrawable.h
@@ -74,12 +74,13 @@
/**
* Snaps off a GpuDrawHandler to represent the state of the SkDrawable at the time the snap is
* called. This is used for executing GPU backend specific draws intermixed with normal Skia GPU
- * draws. The GPU API, which will be used for the draw, as well as the full matrix are passed in
- * as inputs.
+ * draws. The GPU API, which will be used for the draw, as well as the full matrix and device
+ * clip bounds are passed in as inputs.
*/
std::unique_ptr<GpuDrawHandler> snapGpuDrawHandler(GrBackendApi backendApi,
- const SkMatrix& matrix) {
- return this->onSnapGpuDrawHandler(backendApi, matrix);
+ const SkMatrix& matrix,
+ const SkIRect& clipBounds) {
+ return this->onSnapGpuDrawHandler(backendApi, matrix, clipBounds);
}
SkPicture* newPictureSnapshot();
@@ -131,6 +132,12 @@
virtual SkRect onGetBounds() = 0;
virtual void onDraw(SkCanvas*) = 0;
+ virtual std::unique_ptr<GpuDrawHandler> onSnapGpuDrawHandler(GrBackendApi, const SkMatrix&,
+ const SkIRect& /*clipBounds*/) {
+ return nullptr;
+ }
+
+ // TODO: Delete this once Android gets updated to take the clipBounds version above.
virtual std::unique_ptr<GpuDrawHandler> onSnapGpuDrawHandler(GrBackendApi, const SkMatrix&) {
return nullptr;
}
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 3211a1e..021ace5 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -78,14 +78,6 @@
}
bool hasMixedSamples() const { return fSurfaceFlags & GrInternalSurfaceFlags::kMixedSampled; }
- void setSupportsWindowRects() {
- SkASSERT(this->asRenderTarget());
- fSurfaceFlags |= GrInternalSurfaceFlags::kWindowRectsSupport;
- }
- bool supportsWindowRects() const {
- return fSurfaceFlags & GrInternalSurfaceFlags::kWindowRectsSupport;
- }
-
void setGLRTFBOIDIs0() {
SkASSERT(this->asRenderTarget());
fSurfaceFlags |= GrInternalSurfaceFlags::kGLRTFBOIDIs0;
diff --git a/include/gpu/gl/GrGLConfig.h b/include/gpu/gl/GrGLConfig.h
index 1526f06..969128d 100644
--- a/include/gpu/gl/GrGLConfig.h
+++ b/include/gpu/gl/GrGLConfig.h
@@ -114,10 +114,6 @@
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1
#endif
-#if !defined(GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT)
- #define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0
-#endif
-
#if !defined(GR_GL_MUST_USE_VBO)
#define GR_GL_MUST_USE_VBO 0
#endif
diff --git a/include/gpu/gl/GrGLConfig_chrome.h b/include/gpu/gl/GrGLConfig_chrome.h
index 838e054..3ab1ab3 100644
--- a/include/gpu/gl/GrGLConfig_chrome.h
+++ b/include/gpu/gl/GrGLConfig_chrome.h
@@ -19,9 +19,6 @@
// compositor also doesn't check its allocations.
#define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0
-// CheckFramebufferStatus in chrome synchronizes the gpu and renderer processes.
-#define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 1
-
// Non-VBO vertices and indices are not allowed in Chromium.
#define GR_GL_MUST_USE_VBO 1
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index 1f5b79f..bdc51d1 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -94,13 +94,6 @@
}
bool hasMixedSamples() const { return fSurfaceFlags & GrInternalSurfaceFlags::kMixedSampled; }
- void setSupportsWindowRects() {
- fSurfaceFlags |= GrInternalSurfaceFlags::kWindowRectsSupport;
- }
- bool supportsWindowRects() const {
- return fSurfaceFlags & GrInternalSurfaceFlags::kWindowRectsSupport;
- }
-
void setGLRTFBOIDIs0() {
fSurfaceFlags |= GrInternalSurfaceFlags::kGLRTFBOIDIs0;
}
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index 243a54f..29ab814 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -851,17 +851,10 @@
// are supported
kMixedSampled = 1 << 2,
- // For internal resources:
- // this is enabled whenever GrCaps reports window rect support
- // For wrapped resources1
- // this is disabled for FBO0
- // but, otherwise, is enabled whenever GrCaps reports window rect support
- kWindowRectsSupport = 1 << 3,
-
// This flag is for use with GL only. It tells us that the internal render target wraps FBO 0.
- kGLRTFBOIDIs0 = 1 << 4,
+ kGLRTFBOIDIs0 = 1 << 3,
- kRenderTargetMask = kMixedSampled | kWindowRectsSupport | kGLRTFBOIDIs0,
+ kRenderTargetMask = kMixedSampled | kGLRTFBOIDIs0,
};
GR_MAKE_BITFIELD_CLASS_OPS(GrInternalSurfaceFlags)
diff --git a/infra/config/recipes.cfg b/infra/config/recipes.cfg
index 84066a8..78d98d9 100644
--- a/infra/config/recipes.cfg
+++ b/infra/config/recipes.cfg
@@ -14,7 +14,7 @@
"deps": {
"depot_tools": {
"branch": "master",
- "revision": "cf56a4bfb07c8e7361d493754482a9b1177341cf",
+ "revision": "24f2cc0de131c95d25fcbf30369764272f0539f2",
"url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
},
"recipe_engine": {
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp
index c5c150e..24e3b18 100644
--- a/src/core/SkBitmapProcState_matrixProcs.cpp
+++ b/src/core/SkBitmapProcState_matrixProcs.cpp
@@ -14,11 +14,49 @@
*/
#include "SkBitmapProcState.h"
-#include "SkBitmapProcState_utils.h"
#include "SkShader.h"
#include "SkTo.h"
#include "SkUtils.h"
+/*
+ * The decal_ functions require that
+ * 1. dx > 0
+ * 2. [fx, fx+dx, fx+2dx, fx+3dx, ... fx+(count-1)dx] are all <= maxX
+ *
+ * In addition, we use SkFractionalInt to keep more fractional precision than
+ * just SkFixed, so we will abort the decal_ call if dx is very small, since
+ * the decal_ function just operates on SkFixed. If that were changed, we could
+ * skip the very_small test here.
+ */
+static inline bool can_truncate_to_fixed_for_decal(SkFixed fx,
+ SkFixed dx,
+ int count, unsigned max) {
+ SkASSERT(count > 0);
+
+ // if decal_ kept SkFractionalInt precision, this would just be dx <= 0
+ // I just made up the 1/256. Just don't want to perceive accumulated error
+ // if we truncate frDx and lose its low bits.
+ if (dx <= SK_Fixed1 / 256) {
+ return false;
+ }
+
+ // Note: it seems the test should be (fx <= max && lastFx <= max); but
+ // historically it's been a strict inequality check, and changing produces
+ // unexpected diffs. Further investigation is needed.
+
+ // We cast to unsigned so we don't have to check for negative values, which
+ // will now appear as very large positive values, and thus fail our test!
+ if ((unsigned)SkFixedFloorToInt(fx) >= max) {
+ return false;
+ }
+
+ // Promote to 64bit (48.16) to avoid overflow.
+ const uint64_t lastFx = fx + sk_64_mul(dx, count - 1);
+
+ return SkTFitsIn<int32_t>(lastFx) && (unsigned)SkFixedFloorToInt(SkTo<int32_t>(lastFx)) < max;
+}
+
+
// When not filtering, we store 32-bit y, 16-bit x, 16-bit x, 16-bit x, ...
// When filtering we write out 32-bit encodings, pairing 14.4 x0 with 14-bit x1.
@@ -145,6 +183,12 @@
}
}
+// Helper to ensure that when we shift down, we do it w/o sign-extension
+// so the caller doesn't have to manually mask off the top 16 bits.
+static inline unsigned SK_USHIFT16(unsigned x) {
+ return x >> 16;
+}
+
static unsigned clamp(SkFixed fx, int max) {
return SkClampMax(fx >> 16, max);
}
diff --git a/src/core/SkBitmapProcState_utils.h b/src/core/SkBitmapProcState_utils.h
deleted file mode 100644
index b40b45c..0000000
--- a/src/core/SkBitmapProcState_utils.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkBitmapProcState_utils_DEFINED
-#define SkBitmapProcState_utils_DEFINED
-
-#include "SkTo.h"
-
-// Helper to ensure that when we shift down, we do it w/o sign-extension
-// so the caller doesn't have to manually mask off the top 16 bits
-//
-static inline unsigned SK_USHIFT16(unsigned x) {
- return x >> 16;
-}
-
-/*
- * The decal_ functions require that
- * 1. dx > 0
- * 2. [fx, fx+dx, fx+2dx, fx+3dx, ... fx+(count-1)dx] are all <= maxX
- *
- * In addition, we use SkFractionalInt to keep more fractional precision than
- * just SkFixed, so we will abort the decal_ call if dx is very small, since
- * the decal_ function just operates on SkFixed. If that were changed, we could
- * skip the very_small test here.
- */
-static inline bool can_truncate_to_fixed_for_decal(SkFixed fx,
- SkFixed dx,
- int count, unsigned max) {
- SkASSERT(count > 0);
-
- // if decal_ kept SkFractionalInt precision, this would just be dx <= 0
- // I just made up the 1/256. Just don't want to perceive accumulated error
- // if we truncate frDx and lose its low bits.
- if (dx <= SK_Fixed1 / 256) {
- return false;
- }
-
- // Note: it seems the test should be (fx <= max && lastFx <= max); but
- // historically it's been a strict inequality check, and changing produces
- // unexpected diffs. Further investigation is needed.
-
- // We cast to unsigned so we don't have to check for negative values, which
- // will now appear as very large positive values, and thus fail our test!
- if ((unsigned)SkFixedFloorToInt(fx) >= max) {
- return false;
- }
-
- // Promote to 64bit (48.16) to avoid overflow.
- const uint64_t lastFx = fx + sk_64_mul(dx, count - 1);
-
- return SkTFitsIn<int32_t>(lastFx) && (unsigned)SkFixedFloorToInt(SkTo<int32_t>(lastFx)) < max;
-}
-
-#endif /* #ifndef SkBitmapProcState_utils_DEFINED */
diff --git a/src/core/SkDeferredDisplayListPriv.h b/src/core/SkDeferredDisplayListPriv.h
index 12f0319..4675284 100644
--- a/src/core/SkDeferredDisplayListPriv.h
+++ b/src/core/SkDeferredDisplayListPriv.h
@@ -23,6 +23,14 @@
#endif
}
+ const SkDeferredDisplayList::LazyProxyData* lazyProxyData() const {
+#if SK_SUPPORT_GPU
+ return fDDL->fLazyProxyData.get();
+#else
+ return nullptr;
+#endif
+ }
+
private:
explicit SkDeferredDisplayListPriv(SkDeferredDisplayList* ddl) : fDDL(ddl) {}
SkDeferredDisplayListPriv(const SkDeferredDisplayListPriv&); // unimpl
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index ba23f02..da02727 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -132,10 +132,6 @@
// In GL, FBO 0 never supports mixed samples
surfaceFlags |= GrInternalSurfaceFlags::kMixedSampled;
}
- if (fContext->contextPriv().caps()->maxWindowRectangles() > 0 && !usesGLFBO0) {
- // In GL, FBO 0 never supports window rectangles
- surfaceFlags |= GrInternalSurfaceFlags::kWindowRectsSupport;
- }
if (usesGLFBO0) {
surfaceFlags |= GrInternalSurfaceFlags::kGLRTFBOIDIs0;
}
@@ -194,10 +190,20 @@
return nullptr;
}
+ if (fSurface) {
+ SkCanvas* canvas = fSurface->getCanvas();
+
+ canvas->restoreToCount(0);
+ }
+
auto ddl = std::unique_ptr<SkDeferredDisplayList>(
new SkDeferredDisplayList(fCharacterization, std::move(fLazyProxyData)));
fContext->contextPriv().moveOpListsToDDL(ddl.get());
+
+ // We want a new lazy proxy target for each recorded DDL so force the (lazy proxy-backed)
+ // SkSurface to be regenerated for each DDL.
+ fSurface = nullptr;
return ddl;
}
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index 856eff5..0059870 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -260,7 +260,7 @@
// scale factor is used to increase the size of the destination rectangles. The destination
// rectangles are then scaled, rotated, etc. by the GPU using the view matrix.
void SkGlyphRunListPainter::processARGBFallback(
- SkScalar maxGlyphDimension, const SkPaint& runPaint, const SkFont& runFont,
+ SkScalar maxGlyphDimension, const SkPaint& runPaint,
const SkMatrix& viewMatrix, SkScalar textScale, ARGBFallback argbFallback) {
SkASSERT(!fARGBGlyphsIDs.empty());
@@ -289,13 +289,7 @@
}
auto positions = SkSpan<const SkPoint>{fARGBPositions};
- argbFallback(runPaint,
- runFont,
- glyphIDs,
- positions,
- SK_Scalar1,
- viewMatrix,
- kTransformDone);
+ argbFallback(runPaint, glyphIDs, positions, SK_Scalar1, viewMatrix, kTransformDone);
} else {
// If the matrix is complicated or if scaling is used to fit the glyphs in the cache,
@@ -321,17 +315,12 @@
// for larger text sizes.
fallbackTextSize = std::min(fallbackTextSize, 256.0f);
- SkFont fallbackFont{runFont};
- fallbackFont.setSize(fallbackTextSize);
+ SkPaint fallbackPaint{runPaint};
+ fallbackPaint.setTextSize(fallbackTextSize);
SkScalar fallbackTextScale = runPaintTextSize / fallbackTextSize;
auto positions = SkSpan<const SkPoint>{fARGBPositions};
- argbFallback(runPaint,
- fallbackFont,
- glyphIDs,
- positions,
- fallbackTextScale,
- SkMatrix::I(),
- kDoTransform);
+ argbFallback(
+ fallbackPaint, glyphIDs, positions, fallbackTextScale, SkMatrix::I(), kDoTransform);
}
}
@@ -367,8 +356,10 @@
}
if (!fARGBGlyphsIDs.empty()) {
+ SkPaint fallbackPaint{runPaint};
+ glyphRun.font().LEGACY_applyToPaint(&fallbackPaint);
this->processARGBFallback(
- maxFallbackDimension, runPaint, glyphRun.font(), viewMatrix, textScale,
+ maxFallbackDimension, fallbackPaint, viewMatrix, textScale,
std::move(argbFallback));
}
@@ -416,7 +407,7 @@
template <typename PerEmptyT, typename PerSDFT, typename PerPathT>
void SkGlyphRunListPainter::drawGlyphRunAsSDFWithARGBFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
- SkPoint origin, const SkPaint& runPaint, const SkMatrix& viewMatrix, SkScalar textScale,
+ SkPoint origin, const SkPaint& paint, const SkMatrix& viewMatrix, SkScalar textScale,
PerEmptyT&& perEmpty, PerSDFT&& perSDF, PerPathT&& perPath, ARGBFallback&& argbFallback) {
fARGBGlyphsIDs.clear();
fARGBPositions.clear();
@@ -453,8 +444,10 @@
}
if (!fARGBGlyphsIDs.empty()) {
+ SkPaint runPaint{paint};
+ glyphRun.font().LEGACY_applyToPaint(&runPaint);
this->processARGBFallback(
- maxFallbackDimension, runPaint, glyphRun.font(), viewMatrix, textScale,
+ maxFallbackDimension, runPaint, viewMatrix, textScale,
std::move(argbFallback));
}
}
@@ -678,20 +671,17 @@
const SkGlyphRunList& glyphRunList,
SkGlyphRunListPainter* glyphPainter) {
struct ARGBFallbackHelper {
- void operator()(const SkPaint& fallbackPaint, const SkFont& fallbackFont,
- SkSpan<const SkGlyphID> glyphIDs,
- SkSpan<const SkPoint> positions, SkScalar textScale,
- const SkMatrix& glyphCacheMatrix,
- SkGlyphRunListPainter::NeedsTransform needsTransform) const {
+ void operator ()(const SkPaint& fallbackPaint, SkSpan<const SkGlyphID> glyphIDs,
+ SkSpan<const SkPoint> positions, SkScalar textScale,
+ const SkMatrix& glyphCacheMatrix,
+ SkGlyphRunListPainter::NeedsTransform needsTransform) const {
fBlob->setHasBitmap();
fRun->setSubRunHasW(glyphCacheMatrix.hasPerspective());
auto subRun = fRun->initARGBFallback();
+ SkFont font = SkFont::LEGACY_ExtractFromPaint(fallbackPaint);
SkExclusiveStrikePtr fallbackCache =
- fRun->setupCache(fallbackPaint,
- fallbackFont,
- fProps,
- fScalerContextFlags,
- glyphCacheMatrix);
+ fRun->setupCache(
+ fallbackPaint, font, fProps, fScalerContextFlags, glyphCacheMatrix);
sk_sp<GrTextStrike> strike = fGlyphCache->getStrike(fallbackCache.get());
SkASSERT(strike != nullptr);
subRun->setStrike(strike);
@@ -731,10 +721,16 @@
// Setup distance field runPaint and text ratio
SkScalar textScale;
SkPaint distanceFieldPaint{runPaint};
- runFont.LEGACY_applyToPaint(&distanceFieldPaint);
+ SkFont distanceFieldFont{runFont};
SkScalerContextFlags flags;
- GrTextContext::InitDistanceFieldPaint(this, &distanceFieldPaint, viewMatrix,
- options, &textScale, &flags);
+ GrTextContext::InitDistanceFieldPaint(runFont.getSize(),
+ viewMatrix,
+ options,
+ this,
+ &distanceFieldPaint,
+ &distanceFieldFont,
+ &textScale,
+ &flags);
this->setHasDistanceField();
run->setSubRunHasDistanceFields(
runFont.getEdging() == SkFont::Edging::kSubpixelAntiAlias,
@@ -742,8 +738,8 @@
hasWCoord);
{
- SkFont font = SkFont::LEGACY_ExtractFromPaint(distanceFieldPaint);
- auto cache = run->setupCache(distanceFieldPaint, font, props, flags, SkMatrix::I());
+ auto cache = run->setupCache(
+ distanceFieldPaint, distanceFieldFont, props, flags, SkMatrix::I());
sk_sp<GrTextStrike> currStrike = glyphCache->getStrike(cache.get());
@@ -943,15 +939,14 @@
}
struct ARGBHelper {
- void operator()(const SkPaint& fallbackPaint,
- const SkFont& fallbackFont,
- SkSpan<const SkGlyphID> glyphIDs,
- SkSpan<const SkPoint> positions,
- SkScalar textScale,
- const SkMatrix& glyphCacheMatrix,
- SkGlyphRunListPainter::NeedsTransform needsTransform) {
+ void operator () (const SkPaint& fallbackPaint, SkSpan<const SkGlyphID> glyphIDs,
+ SkSpan<const SkPoint> positions, SkScalar textScale,
+ const SkMatrix& glyphCacheMatrix,
+ SkGlyphRunListPainter::NeedsTransform needsTransform) {
TRACE_EVENT0("skia", "argbFallback");
+ SkFont fallbackFont = SkFont::LEGACY_ExtractFromPaint(fallbackPaint);
+
SkScalerContextEffects effects;
auto* fallbackCache =
fStrikeServer->getOrCreateCache(
@@ -1022,13 +1017,18 @@
}
SkScalar textRatio;
- SkPaint dfPaint(runPaint);
- runFont.LEGACY_applyToPaint(&dfPaint);
+ SkPaint dfPaint{runPaint};
+ SkFont dfFont{runFont};
SkScalerContextFlags flags;
- GrTextContext::InitDistanceFieldPaint(nullptr, &dfPaint, runMatrix, options, &textRatio,
+ GrTextContext::InitDistanceFieldPaint(runFont.getSize(),
+ runMatrix,
+ options,
+ nullptr,
+ &dfPaint,
+ &dfFont,
+ &textRatio,
&flags);
SkScalerContextEffects effects;
- SkFont dfFont = SkFont::LEGACY_ExtractFromPaint(dfPaint);
auto* sdfCache = fStrikeServer->getOrCreateCache(dfPaint, dfFont, this->surfaceProps(),
SkMatrix::I(), flags, &effects);
diff --git a/src/core/SkGlyphRunPainter.h b/src/core/SkGlyphRunPainter.h
index 7a464f8..e3129f6 100644
--- a/src/core/SkGlyphRunPainter.h
+++ b/src/core/SkGlyphRunPainter.h
@@ -82,7 +82,6 @@
using ARGBFallback =
std::function<void(const SkPaint& fallbackPaint, // The run paint maybe with a new text size
- const SkFont& fallbackFont,
SkSpan<const SkGlyphID> fallbackGlyphIDs, // Colored glyphs
SkSpan<const SkPoint> fallbackPositions, // Positions of above glyphs
SkScalar fallbackTextScale, // Scale factor for glyph
@@ -104,7 +103,7 @@
template <typename PerEmptyT, typename PerSDFT, typename PerPathT>
void drawGlyphRunAsSDFWithARGBFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
- SkPoint origin, const SkPaint& runPaint, const SkMatrix& viewMatrix, SkScalar textRatio,
+ SkPoint origin, const SkPaint& paint, const SkMatrix& viewMatrix, SkScalar textRatio,
PerEmptyT&& perEmpty, PerSDFT&& perSDF, PerPathT&& perPath, ARGBFallback&& perFallback);
// TODO: Make this the canonical check for Skia.
@@ -114,7 +113,7 @@
void ensureBitmapBuffers(size_t runSize);
void processARGBFallback(
- SkScalar maxGlyphDimension, const SkPaint& fallbackPaint, const SkFont& fallbackFont,
+ SkScalar maxGlyphDimension, const SkPaint& runPaint,
const SkMatrix& viewMatrix, SkScalar textScale, ARGBFallback argbFallback);
// The props as on the actual device.
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index dcf642b..c6a0990 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -221,9 +221,6 @@
if (fCaps->usesMixedSamples() && sampleCnt > 1) {
surfaceFlags |= GrInternalSurfaceFlags::kMixedSampled;
}
- if (fCaps->maxWindowRectangles() > 0) {
- surfaceFlags |= GrInternalSurfaceFlags::kWindowRectsSupport;
- }
}
GrSurfaceDesc desc;
@@ -572,9 +569,6 @@
if (SkToBool(surfaceFlags & GrInternalSurfaceFlags::kMixedSampled)) {
SkASSERT(fCaps->usesMixedSamples() && desc.fSampleCnt > 1);
}
- if (SkToBool(surfaceFlags & GrInternalSurfaceFlags::kWindowRectsSupport)) {
- SkASSERT(fCaps->maxWindowRectangles() > 0);
- }
}
#endif
@@ -603,9 +597,6 @@
if (SkToBool(surfaceFlags & GrInternalSurfaceFlags::kMixedSampled)) {
SkASSERT(fCaps->usesMixedSamples() && desc.fSampleCnt > 1);
}
- if (SkToBool(surfaceFlags & GrInternalSurfaceFlags::kWindowRectsSupport)) {
- SkASSERT(fCaps->maxWindowRectangles() > 0);
- }
#endif
using LazyInstantiationType = GrSurfaceProxy::LazyInstantiationType;
@@ -633,9 +624,6 @@
GrInternalSurfaceFlags surfaceFlags = GrInternalSurfaceFlags::kNoPendingIO;
if (Renderable::kYes == renderable) {
desc.fFlags = kRenderTarget_GrSurfaceFlag;
- if (caps.maxWindowRectangles() > 0) {
- surfaceFlags |= GrInternalSurfaceFlags::kWindowRectsSupport;
- }
}
desc.fWidth = -1;
desc.fHeight = -1;
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 5e827ec..e654648 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -25,7 +25,6 @@
, fStencilAttachment(stencil) {
SkASSERT(desc.fFlags & kRenderTarget_GrSurfaceFlag);
SkASSERT(!this->hasMixedSamples() || fSampleCnt > 1);
- SkASSERT(!this->supportsWindowRects() || gpu->caps()->maxWindowRectangles() > 0);
fResolveRect = SkRectPriv::MakeILargestInverted();
}
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 39fdee3..3e3e245 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -31,9 +31,6 @@
if (caps.usesMixedSamples() && fSampleCnt > 1) {
this->setHasMixedSamples();
}
- if (caps.maxWindowRectangles() > 0) {
- this->setSupportsWindowRects();
- }
}
// Lazy-callback version
@@ -57,7 +54,7 @@
}
int GrRenderTargetProxy::maxWindowRectangles(const GrCaps& caps) const {
- return this->supportsWindowRects() ? caps.maxWindowRectangles() : 0;
+ return this->glRTFBOIDIs0() ? 0 : caps.maxWindowRectangles();
}
bool GrRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) {
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 1ca23df..e82edbe 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1709,7 +1709,7 @@
const SkMatrix& ctm = canvas->getTotalMatrix();
const SkMatrix& combinedMatrix = matrix ? SkMatrix::Concat(ctm, *matrix) : ctm;
std::unique_ptr<SkDrawable::GpuDrawHandler> gpuDraw =
- drawable->snapGpuDrawHandler(api, combinedMatrix);
+ drawable->snapGpuDrawHandler(api, combinedMatrix, canvas->getDeviceClipBounds());
if (gpuDraw) {
fRenderTargetContext->drawDrawable(std::move(gpuDraw), drawable->getBounds());
return;
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 7344dd7..5e0a2fb 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -44,9 +44,6 @@
SkASSERT(glCaps.usesMixedSamples() && idDesc.fRTFBOID); // FBO 0 can't be mixed sampled.
this->setHasMixedSamples();
}
- if (glCaps.maxWindowRectangles() > 0 && idDesc.fRTFBOID) {
- this->setSupportsWindowRects();
- }
if (!idDesc.fRTFBOID) {
this->setGLRTFBOIDIs0();
}
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 762c880..a031f95 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -307,7 +307,7 @@
static bool is_renderer_angle(const char* rendererString) {
static constexpr char kHeader[] = "ANGLE ";
static constexpr size_t kHeaderLength = SK_ARRAY_COUNT(kHeader) - 1;
- return 0 == strncmp(rendererString, kHeader, kHeaderLength);
+ return rendererString && 0 == strncmp(rendererString, kHeader, kHeaderLength);
}
GrGLRenderer GrGLGetRendererFromStrings(const char* rendererString,
diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp
index 4e9b42b..2d8d163 100644
--- a/src/gpu/text/GrTextContext.cpp
+++ b/src/gpu/text/GrTextContext.cpp
@@ -129,13 +129,14 @@
return true;
}
-void GrTextContext::InitDistanceFieldPaint(GrTextBlob* blob,
- SkPaint* skPaint,
+void GrTextContext::InitDistanceFieldPaint(const SkScalar textSize,
const SkMatrix& viewMatrix,
const Options& options,
+ GrTextBlob* blob,
+ SkPaint* skPaint,
+ SkFont* skFont,
SkScalar* textRatio,
SkScalerContextFlags* flags) {
- SkScalar textSize = skPaint->getTextSize();
SkScalar scaledTextSize = textSize;
if (viewMatrix.hasPerspective()) {
@@ -160,17 +161,17 @@
dfMaskScaleFloor = options.fMinDistanceFieldFontSize;
dfMaskScaleCeil = kSmallDFFontLimit;
*textRatio = textSize / kSmallDFFontSize;
- skPaint->setTextSize(SkIntToScalar(kSmallDFFontSize));
+ skFont->setSize(SkIntToScalar(kSmallDFFontSize));
} else if (scaledTextSize <= kMediumDFFontLimit) {
dfMaskScaleFloor = kSmallDFFontLimit;
dfMaskScaleCeil = kMediumDFFontLimit;
*textRatio = textSize / kMediumDFFontSize;
- skPaint->setTextSize(SkIntToScalar(kMediumDFFontSize));
+ skFont->setSize(SkIntToScalar(kMediumDFFontSize));
} else {
dfMaskScaleFloor = kMediumDFFontLimit;
dfMaskScaleCeil = options.fMaxDistanceFieldFontSize;
*textRatio = textSize / kLargeDFFontSize;
- skPaint->setTextSize(SkIntToScalar(kLargeDFFontSize));
+ skFont->setSize(SkIntToScalar(kLargeDFFontSize));
}
// Because there can be multiple runs in the blob, we want the overall maxMinScale, and
@@ -186,11 +187,10 @@
dfMaskScaleCeil / scaledTextSize);
}
- skPaint->setAntiAlias(true);
- skPaint->setLCDRenderText(false);
- skPaint->setAutohinted(false);
- skPaint->setHinting(kNormal_SkFontHinting);
- skPaint->setSubpixelText(true);
+ skFont->setEdging(SkFont::Edging::kAntiAlias);
+ skFont->setForceAutoHinting(false);
+ skFont->setHinting(kNormal_SkFontHinting);
+ skFont->setSubpixel(true);
skPaint->setMaskFilter(GrSDFMaskFilter::Make());
diff --git a/src/gpu/text/GrTextContext.h b/src/gpu/text/GrTextContext.h
index 604f168..46f5d3f 100644
--- a/src/gpu/text/GrTextContext.h
+++ b/src/gpu/text/GrTextContext.h
@@ -61,10 +61,12 @@
const SkSurfaceProps& props,
bool contextSupportsDistanceFieldText,
const Options& options);
- static void InitDistanceFieldPaint(GrTextBlob* blob,
- SkPaint* skPaint,
+ static void InitDistanceFieldPaint(SkScalar textSize,
const SkMatrix& viewMatrix,
const Options& options,
+ GrTextBlob* blob,
+ SkPaint* skPaint,
+ SkFont* skFont,
SkScalar* textRatio,
SkScalerContextFlags* flags);
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index 12793d6..3f03ae1 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -23,6 +23,7 @@
#include "SkCanvas.h"
#include "SkColorSpace.h"
#include "SkDeferredDisplayList.h"
+#include "SkDeferredDisplayListPriv.h"
#include "SkDeferredDisplayListRecorder.h"
#include "SkGpuDevice.h"
#include "SkImage.h"
@@ -803,6 +804,61 @@
}
////////////////////////////////////////////////////////////////////////////////
+// Ensure that reusing a single DDLRecorder to create multiple DDLs works cleanly
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLMultipleDDLs, reporter, ctxInfo) {
+ GrContext* context = ctxInfo.grContext();
+
+ SkImageInfo ii = SkImageInfo::MakeN32Premul(32, 32);
+ sk_sp<SkSurface> s = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii);
+
+ SkBitmap bitmap;
+ bitmap.allocPixels(ii);
+
+ SkSurfaceCharacterization characterization;
+ SkAssertResult(s->characterize(&characterization));
+
+ SkDeferredDisplayListRecorder recorder(characterization);
+
+ SkCanvas* canvas1 = recorder.getCanvas();
+
+ canvas1->clear(SK_ColorRED);
+
+ canvas1->save();
+ canvas1->clipRect(SkRect::MakeXYWH(8, 8, 16, 16));
+
+ std::unique_ptr<SkDeferredDisplayList> ddl1 = recorder.detach();
+
+ SkCanvas* canvas2 = recorder.getCanvas();
+
+ SkPaint p;
+ p.setColor(SK_ColorGREEN);
+ canvas2->drawRect(SkRect::MakeWH(32, 32), p);
+
+ std::unique_ptr<SkDeferredDisplayList> ddl2 = recorder.detach();
+
+ REPORTER_ASSERT(reporter, ddl1->priv().lazyProxyData());
+ REPORTER_ASSERT(reporter, ddl2->priv().lazyProxyData());
+
+ // The lazy proxy data being different ensures that the SkSurface, SkCanvas and backing-
+ // lazy proxy are all different between the two DDLs
+ REPORTER_ASSERT(reporter, ddl1->priv().lazyProxyData() != ddl2->priv().lazyProxyData());
+
+ s->draw(ddl1.get());
+ s->draw(ddl2.get());
+
+ // Make sure the clipRect from DDL1 didn't percolate into DDL2
+ s->readPixels(ii, bitmap.getPixels(), bitmap.rowBytes(), 0, 0);
+ for (int y = 0; y < 32; ++y) {
+ for (int x = 0; x < 32; ++x) {
+ REPORTER_ASSERT(reporter, bitmap.getColor(x, y) == SK_ColorGREEN);
+ if (bitmap.getColor(x, y) != SK_ColorGREEN) {
+ return; // we only really need to report the error once
+ }
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
// Check that the texture-specific flags (i.e., for external & rectangle textures) work
// for promise images. As such, this is a GL-only test.
DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(DDLTextureFlagsTest, reporter, ctxInfo) {
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index f92c1ef..11d070d 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -5394,3 +5394,21 @@
REPORTER_ASSERT(r, path.getConvexity() == SkPath::kConvex_Convexity);
survive(&path, x, false, r, [](const SkPath& p) { return true; });
}
+
+DEF_TEST(path_last_move_to_index, r) {
+ // Make sure that copyPath is safe after the call to path.offset().
+ // Previously, we would leave its fLastMoveToIndex alone after the copy, but now we should
+ // set it to path's value inside SkPath::transform()
+
+ SkPath path;
+ SkPath copyPath;
+
+ SkPaint paint;
+ paint.getTextPath("hello", 5, 20, 80, &(copyPath)); // <== init copyPath, set fake copyPath.fLastMoveToIndex
+
+ SkScalar radii[] = { 80, 100, 0, 0, 40, 60, 0, 0 };;
+ path.addRoundRect({10, 10, 110, 110}, radii);
+ path.offset(0, 5, &(copyPath)); // <== change buffer copyPath.fPathRef->fPoints but not reset copyPath.fLastMoveToIndex lead to out of bound
+
+ copyPath.rConicTo(1, 1, 3, 3, 0.707107f);
+}
diff --git a/tests/PromiseImageTest.cpp b/tests/PromiseImageTest.cpp
index 7224461..216d656 100644
--- a/tests/PromiseImageTest.cpp
+++ b/tests/PromiseImageTest.cpp
@@ -10,7 +10,6 @@
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
-#include "SkDeferredDisplayListRecorder.h"
#include "SkImage_Gpu.h"
using namespace sk_gpu_test;
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index daf13c3..ab24b00 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -314,9 +314,6 @@
auto lazyType = deinstantiate ? GrSurfaceProxy::LazyInstantiationType ::kDeinstantiate
: GrSurfaceProxy::LazyInstantiationType ::kSingleUse;
GrInternalSurfaceFlags flags = GrInternalSurfaceFlags::kNone;
- if (p.fIsRT && caps->maxWindowRectangles() > 0) {
- flags = GrInternalSurfaceFlags::kWindowRectsSupport;
- }
return proxyProvider->createLazyProxy(callback, format, desc, p.fOrigin, GrMipMapped::kNo,
flags, p.fFit, SkBudgeted::kNo, lazyType);
}
diff --git a/tests/VkDrawableTest.cpp b/tests/VkDrawableTest.cpp
index 8bb1251..0ff94aa 100644
--- a/tests/VkDrawableTest.cpp
+++ b/tests/VkDrawableTest.cpp
@@ -87,7 +87,8 @@
};
std::unique_ptr<GpuDrawHandler> onSnapGpuDrawHandler(GrBackendApi backendApi,
- const SkMatrix& matrix) override {
+ const SkMatrix& matrix,
+ const SkIRect& clipBounds) override {
if (backendApi != GrBackendApi::kVulkan) {
return nullptr;
}