xref: /third_party/skia/src/gpu/dawn/GrDawnTextureRenderTarget.cpp (revision cb93a386)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/src/gpu/dawn/
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 "src/gpu/GrTexture.h"
12#include "src/gpu/dawn/GrDawnGpu.h"
13
14GrDawnTextureRenderTarget::GrDawnTextureRenderTarget(GrDawnGpu* gpu,
15                                                     SkISize dimensions,
16                                                     int sampleCnt,
17                                                     const GrDawnTextureInfo& textureInfo,
18                                                     GrMipmapStatus mipmapStatus)
19        : GrSurface(gpu, dimensions, GrProtected::kNo)
20        , GrDawnTexture(gpu, dimensions, textureInfo, mipmapStatus)
21        , GrDawnRenderTarget(gpu, dimensions, sampleCnt,
22                             GrDawnRenderTargetInfo(textureInfo)) {}
23
24bool GrDawnTextureRenderTarget::canAttemptStencilAttachment(bool useMSAASurface) const {
25    SkASSERT(useMSAASurface == (this->numSamples() > 1));
26    return true;
27}
28
29size_t GrDawnTextureRenderTarget::onGpuMemorySize() const {
30    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
31                                  1,  // FIXME: for MSAA
32                                  this->mipmapped());
33}
34

Indexes created Thu Nov 07 10:32:03 CST 2024