Commit faacc850 authored by Justin Novosad's avatar Justin Novosad Committed by Commit Bot

Remove virtual calls from CanvasResource destructors.

BUG=790699

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I432ad3103df1d07732b2629384dc074cb6002a21
Reviewed-on: https://chromium-review.googlesource.com/806692Reviewed-by: default avatarOlivia Lai <xlai@chromium.org>
Commit-Queue: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521741}
parent cfe4f098
......@@ -85,7 +85,7 @@ bool CanvasResource_Skia::IsValid() const {
return !!context_provider_wrapper_;
}
void CanvasResource_Skia::Abandon() {
void CanvasResource_Skia::TearDown() {
WaitSyncTokenBeforeRelease();
auto gl = ContextGL();
if (gl && HasGpuMailbox()) {
......@@ -147,7 +147,7 @@ CanvasResource_GpuMemoryBuffer::CanvasResource_GpuMemoryBuffer(
}
CanvasResource_GpuMemoryBuffer::~CanvasResource_GpuMemoryBuffer() {
Abandon();
TearDown();
}
scoped_refptr<CanvasResource_GpuMemoryBuffer>
......@@ -164,7 +164,7 @@ CanvasResource_GpuMemoryBuffer::Create(
return nullptr;
}
void CanvasResource_GpuMemoryBuffer::Abandon() {
void CanvasResource_GpuMemoryBuffer::TearDown() {
WaitSyncTokenBeforeRelease();
if (!context_provider_wrapper_ || !image_id_)
return;
......
......@@ -52,16 +52,17 @@ class PLATFORM_EXPORT CanvasResource_Skia final : public CanvasResource {
static scoped_refptr<CanvasResource_Skia> Create(
sk_sp<SkImage>,
base::WeakPtr<WebGraphicsContext3DProviderWrapper>);
virtual ~CanvasResource_Skia() { Abandon(); }
virtual ~CanvasResource_Skia() { TearDown(); }
// Not recyclable: Skia handles texture recycling internally and bitmaps are
// cheap to allocate.
bool IsRecycleable() const final { return false; }
bool IsValid() const final;
void Abandon() final;
void Abandon() final { TearDown(); }
GLuint TextureId() const final;
private:
void TearDown();
CanvasResource_Skia(sk_sp<SkImage>,
base::WeakPtr<WebGraphicsContext3DProviderWrapper>);
......@@ -79,10 +80,11 @@ class PLATFORM_EXPORT CanvasResource_GpuMemoryBuffer final
virtual ~CanvasResource_GpuMemoryBuffer();
bool IsRecycleable() const final { return IsValid(); }
bool IsValid() const { return context_provider_wrapper_ && image_id_; }
void Abandon() final;
void Abandon() final { TearDown(); }
GLuint TextureId() const final { return texture_id_; }
private:
void TearDown();
CanvasResource_GpuMemoryBuffer(
const IntSize&,
const CanvasColorParams&,
......
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