• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 Google LLC
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 "include/gpu/mock/GrMockTypes.h"
9 
10 #include "include/gpu/GrBackendSurface.h"
11 
getBackendFormat() const12 GrBackendFormat GrMockRenderTargetInfo::getBackendFormat() const {
13     return GrBackendFormat::MakeMock(fColorType, SkImage::CompressionType::kNone);
14 }
15 
getBackendFormat() const16 GrBackendFormat GrMockTextureInfo::getBackendFormat() const {
17     return GrBackendFormat::MakeMock(fColorType, fCompressionType);
18 }
19 
GrMockTextureSpecToSurfaceInfo(const GrMockTextureSpec & mockSpec,uint32_t sampleCount,uint32_t levelCount,GrProtected isProtected)20 GrMockSurfaceInfo GrMockTextureSpecToSurfaceInfo(const GrMockTextureSpec& mockSpec,
21                                                  uint32_t sampleCount,
22                                                  uint32_t levelCount,
23                                                  GrProtected isProtected) {
24     GrMockSurfaceInfo info;
25     // Shared info
26     info.fSampleCount = sampleCount;
27     info.fLevelCount = levelCount;
28     info.fProtected = isProtected;
29 
30     // Mock info
31     info.fColorType = mockSpec.fColorType;
32     info.fCompressionType = mockSpec.fCompressionType;
33 
34     return info;
35 }
36