Commit 01462f98 authored by Adlai Holler's avatar Adlai Holler Committed by Commit Bot

Migrate to GrRecordingContext version of SkImage::isValid

This unblocks http://review.skia.org/304776. After that lands, we can
come back and remove the explicit cast.

The inclusion of GrDirectContext.h is "jumping ahead" to where Chromium
CL 2297920 is taking us, and it is in the process of landing. We could
have imported GrContext.h but then we'd have a needless conflict.

Bug: skia:104662
Change-Id: Ibc6b5a5061577bca59a3b57ce16a1af0298d0f5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310974
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790604}
parent 53cfb65b
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
namespace blink { namespace blink {
namespace { namespace {
...@@ -238,9 +239,11 @@ void AcceleratedStaticBitmapImage::Draw( ...@@ -238,9 +239,11 @@ void AcceleratedStaticBitmapImage::Draw(
} }
bool AcceleratedStaticBitmapImage::IsValid() const { bool AcceleratedStaticBitmapImage::IsValid() const {
// TODO: Remove explicit cast after http://review.skia.org/304776 lands.
if (texture_backing_ && (!skia_context_provider_wrapper_ || if (texture_backing_ && (!skia_context_provider_wrapper_ ||
!texture_backing_->GetAcceleratedSkImage()->isValid( !texture_backing_->GetAcceleratedSkImage()->isValid(
ContextProvider()->GetGrContext()))) { static_cast<GrRecordingContext*>(
ContextProvider()->GetGrContext())))) {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment