| 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/ganesh/mock/GrMockTypes.h" |
| 9 |
|
| 10 |
#include "include/core/SkTextureCompressionType.h" |
| 11 |
#include "include/gpu/ganesh/GrBackendSurface.h" |
| 12 |
#include "include/gpu/ganesh/GrTypes.h" |
| 13 |
#include "src/gpu/ganesh/mock/GrMockTypesPriv.h" |
| 14 |
|
| 15 |
GrBackendFormat GrMockRenderTargetInfo::getBackendFormat() const { |
| 16 |
return GrBackendFormat::MakeMock(fColorType, SkTextureCompressionType::kNone); |
| 17 |
} |
| 18 |
|
| 19 |
GrBackendFormat GrMockTextureInfo::getBackendFormat() const { |
| 20 |
return GrBackendFormat::MakeMock(fColorType, fCompressionType); |
| 21 |
} |
| 22 |
|
| 23 |
GrMockSurfaceInfo GrMockTextureSpecToSurfaceInfo(const GrMockTextureSpec& mockSpec, |
| 24 |
uint32_t sampleCount, |
| 25 |
uint32_t levelCount, |
| 26 |
GrProtected isProtected) { |
| 27 |
GrMockSurfaceInfo info; |
| 28 |
// Shared info |
| 29 |
info.fSampleCount = sampleCount; |
| 30 |
info.fLevelCount = levelCount; |
| 31 |
info.fProtected = isProtected; |
| 32 |
|
| 33 |
// Mock info |
| 34 |
info.fColorType = mockSpec.fColorType; |
| 35 |
info.fCompressionType = mockSpec.fCompressionType; |
| 36 |
|
| 37 |
return info; |
| 38 |
} |