aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/bitmapshader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/bitmapshader.cpp')
-rw-r--r--gm/bitmapshader.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/gm/bitmapshader.cpp b/gm/bitmapshader.cpp
index 98205d2146..3f3c51e81a 100644
--- a/gm/bitmapshader.cpp
+++ b/gm/bitmapshader.cpp
@@ -5,12 +5,17 @@
* found in the LICENSE file.
*/
#include "gm.h"
-#include "sk_tool_utils.h"
#include "SkBitmap.h"
#include "SkPaint.h"
#include "SkShader.h"
+#include "sk_tool_utils.h"
+
+#if SK_SUPPORT_GPU
+#include "GrCaps.h"
#include "GrContext.h"
+#include "GrContextPriv.h"
+#endif
namespace skiagm {
@@ -116,9 +121,11 @@ DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100) {
// (See https://skia-review.googlesource.com/c/skia/+/73200)
int bitmapW = 1;
int bitmapH = 60000;
+#if SK_SUPPORT_GPU
if (auto* ctx = canvas->getGrContext()) {
- bitmapH = ctx->caps()->maxTextureSize() + 1;
+ bitmapH = ctx->contextPriv().caps()->maxTextureSize() + 1;
}
+#endif
bitmap.setInfo(SkImageInfo::MakeA8(bitmapW, bitmapH), bitmapW);
uint8_t* pixels = new uint8_t[bitmapH];
for(int i = 0; i < bitmapH; ++i) {