Remove SkCanvas::getGrContext calls from samplecode
More busywork so we can deprecate getGrContext.
Change-Id: I8479985334881251e6ad814d7855681df716b1da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301542
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/samplecode/SampleAnimatedText.cpp b/samplecode/SampleAnimatedText.cpp
index d737d03..97fecb7 100644
--- a/samplecode/SampleAnimatedText.cpp
+++ b/samplecode/SampleAnimatedText.cpp
@@ -17,7 +17,7 @@
#include "src/utils/SkUTF.h"
#if SK_SUPPORT_GPU
-#include "include/gpu/GrContext.h"
+#include "include/gpu/GrDirectContext.h"
#include "src/gpu/GrContextPriv.h"
#endif
@@ -68,9 +68,9 @@
canvas->save();
#if SK_SUPPORT_GPU
- GrContext* grContext = canvas->getGrContext();
- if (grContext) {
- sk_sp<SkImage> image = grContext->priv().testingOnly_getFontAtlasImage(
+ auto direct = GrAsDirectContext(canvas->recordingContext());
+ if (direct) {
+ sk_sp<SkImage> image = direct->priv().testingOnly_getFontAtlasImage(
GrMaskFormat::kA8_GrMaskFormat);
canvas->drawImageRect(image,
SkRect::MakeXYWH(512.0f, 10.0f, 512.0f, 512.0f), &paint);