Stephen White | 9d42192 | 2019-08-14 15:07:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "src/gpu/dawn/GrDawnTextureRenderTarget.h" |
| 9 | |
| 10 | #include "include/core/SkTraceMemoryDump.h" |
| 11 | #include "include/gpu/GrContext.h" |
| 12 | #include "src/gpu/GrTexturePriv.h" |
| 13 | #include "src/gpu/dawn/GrDawnGpu.h" |
| 14 | |
| 15 | GrDawnTextureRenderTarget::GrDawnTextureRenderTarget(GrDawnGpu* gpu, |
| 16 | const SkISize& size, |
| 17 | GrPixelConfig config, |
| 18 | dawn::TextureView textureView, |
| 19 | int sampleCnt, |
| 20 | const GrDawnImageInfo& info, |
| 21 | GrMipMapsStatus mipMapsStatus) |
| 22 | : GrSurface(gpu, size, config, GrProtected::kNo) |
| 23 | , GrDawnTexture(gpu, size, config, textureView, info, mipMapsStatus) |
| 24 | , GrDawnRenderTarget(gpu, size, config, sampleCnt, info) { |
| 25 | } |
| 26 | |
| 27 | bool GrDawnTextureRenderTarget::canAttemptStencilAttachment() const { |
| 28 | return true; |
| 29 | } |
| 30 | |
| 31 | size_t GrDawnTextureRenderTarget::onGpuMemorySize() const { |
| 32 | return GrSurface::ComputeSize(this->config(), this->width(), this->height(), |
| 33 | 1, // FIXME: for MSAA |
| 34 | this->texturePriv().mipMapped()); |
| 35 | } |