First implementation of GrTextureRenderTarget.

Change-Id: I0e6bc516eb43e7f7062f9d19e7ef8093324b551d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233997
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/dawn/GrDawnTextureRenderTarget.cpp b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp
new file mode 100644
index 0000000..2494062
--- /dev/null
+++ b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2019 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "src/gpu/dawn/GrDawnTextureRenderTarget.h"
+
+#include "include/core/SkTraceMemoryDump.h"
+#include "include/gpu/GrContext.h"
+#include "src/gpu/GrTexturePriv.h"
+#include "src/gpu/dawn/GrDawnGpu.h"
+
+GrDawnTextureRenderTarget::GrDawnTextureRenderTarget(GrDawnGpu* gpu,
+                                                     const SkISize& size,
+                                                     GrPixelConfig config,
+                                                     dawn::TextureView textureView,
+                                                     int sampleCnt,
+                                                     const GrDawnImageInfo& info,
+                                                     GrMipMapsStatus mipMapsStatus)
+        : GrSurface(gpu, size, config, GrProtected::kNo)
+        , GrDawnTexture(gpu, size, config, textureView, info, mipMapsStatus)
+        , GrDawnRenderTarget(gpu, size, config, sampleCnt, info) {
+}
+
+bool GrDawnTextureRenderTarget::canAttemptStencilAttachment() const {
+    return true;
+}
+
+size_t GrDawnTextureRenderTarget::onGpuMemorySize() const {
+    return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
+                                  1, // FIXME: for MSAA
+                                  this->texturePriv().mipMapped());
+}