Flutter Engine
The Flutter Engine
Enumerations | Functions
GrUtil.h File Reference
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/core/SkSLTypeShared.h"

Go to the source code of this file.

Enumerations

enum  GrIntelGpuFamily {
  kUnknown_IntelGpuFamily , kSandyBridge_IntelGpuFamily , kIvyBridge_IntelGpuFamily , kValleyView_IntelGpuFamily ,
  kHaswell_IntelGpuFamily , kCherryView_IntelGpuFamily , kBroadwell_IntelGpuFamily , kApolloLake_IntelGpuFamily ,
  kSkyLake_IntelGpuFamily , kGeminiLake_IntelGpuFamily , kKabyLake_IntelGpuFamily , kCoffeeLake_IntelGpuFamily ,
  kIceLake_IntelGpuFamily
}
 

Functions

GrIntelGpuFamily GrGetIntelGpuFamily (uint32_t deviceID)
 
bool GrIsStrokeHairlineOrEquivalent (const GrStyle &, const SkMatrix &, SkScalar *outCoverage)
 
static SkSLType SkSLCombinedSamplerTypeForTextureType (GrTextureType type)
 

Enumeration Type Documentation

◆ GrIntelGpuFamily

Enumerator
kUnknown_IntelGpuFamily 
kSandyBridge_IntelGpuFamily 
kIvyBridge_IntelGpuFamily 
kValleyView_IntelGpuFamily 
kHaswell_IntelGpuFamily 
kCherryView_IntelGpuFamily 
kBroadwell_IntelGpuFamily 
kApolloLake_IntelGpuFamily 
kSkyLake_IntelGpuFamily 
kGeminiLake_IntelGpuFamily 
kKabyLake_IntelGpuFamily 
kCoffeeLake_IntelGpuFamily 
kIceLake_IntelGpuFamily 

Definition at line 18 of file GrUtil.h.

18 {
20
21 // 6th gen
23
24 // 7th gen
26 kValleyView_IntelGpuFamily, // aka BayTrail
28
29 // 8th gen
30 kCherryView_IntelGpuFamily, // aka Braswell
32
33 // 9th gen
39
40 // 11th gen
42};
@ kSkyLake_IntelGpuFamily
Definition: GrUtil.h:35
@ kApolloLake_IntelGpuFamily
Definition: GrUtil.h:34
@ kBroadwell_IntelGpuFamily
Definition: GrUtil.h:31
@ kGeminiLake_IntelGpuFamily
Definition: GrUtil.h:36
@ kUnknown_IntelGpuFamily
Definition: GrUtil.h:19
@ kKabyLake_IntelGpuFamily
Definition: GrUtil.h:37
@ kCoffeeLake_IntelGpuFamily
Definition: GrUtil.h:38
@ kValleyView_IntelGpuFamily
Definition: GrUtil.h:26
@ kHaswell_IntelGpuFamily
Definition: GrUtil.h:27
@ kIceLake_IntelGpuFamily
Definition: GrUtil.h:41
@ kSandyBridge_IntelGpuFamily
Definition: GrUtil.h:22
@ kCherryView_IntelGpuFamily
Definition: GrUtil.h:30
@ kIvyBridge_IntelGpuFamily
Definition: GrUtil.h:25

Function Documentation

◆ GrGetIntelGpuFamily()

GrIntelGpuFamily GrGetIntelGpuFamily ( uint32_t  deviceID)

Definition at line 13 of file GrUtil.cpp.

13 {
14 // https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units
15 uint32_t maskedID = deviceID & 0xFF00;
16 switch (maskedID) {
17 case 0x0100:
18 switch (deviceID & 0xFFF0) {
19 case 0x0100:
20 case 0x0110:
21 case 0x0120:
23 case 0x0150:
24 if (deviceID == 0x0155 || deviceID == 0x0157) {
26 }
27 if (deviceID == 0x0152 || deviceID == 0x015A) {
29 }
30 break;
31 case 0x0160:
33 default:
34 break;
35 }
36 break;
37 case 0x0F00:
39 case 0x0400:
40 case 0x0A00:
41 case 0x0D00:
43 case 0x2200:
45 case 0x1600:
47 case 0x5A00:
49 case 0x1900:
51 case 0x3100:
53 case 0x5900:
55 case 0x3E00:
57 case 0x8A00:
59 default:
60 break;
61 }
63}

◆ GrIsStrokeHairlineOrEquivalent()

bool GrIsStrokeHairlineOrEquivalent ( const GrStyle style,
const SkMatrix matrix,
SkScalar outCoverage 
)

Definition at line 65 of file GrUtil.cpp.

67 {
68 if (style.pathEffect()) {
69 return false;
70 }
71 const SkStrokeRec& stroke = style.strokeRec();
72 if (stroke.isHairlineStyle()) {
73 if (outCoverage) {
74 *outCoverage = SK_Scalar1;
75 }
76 return true;
77 }
78 return stroke.getStyle() == SkStrokeRec::kStroke_Style &&
79 SkDrawTreatAAStrokeAsHairline(stroke.getWidth(), matrix, outCoverage);
80}
bool SkDrawTreatAAStrokeAsHairline(SkScalar strokeWidth, const SkMatrix &matrix, SkScalar *coverage)
Definition: SkDrawBase.cpp:262
#define SK_Scalar1
Definition: SkScalar.h:18
SkPathEffect * pathEffect() const
Definition: GrStyle.h:119
const SkStrokeRec & strokeRec() const
Definition: GrStyle.h:140
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ SkSLCombinedSamplerTypeForTextureType()

static SkSLType SkSLCombinedSamplerTypeForTextureType ( GrTextureType  type)
inlinestatic

Definition at line 50 of file GrUtil.h.

50 {
51 switch (type) {
58 default:
59 SK_ABORT("Unexpected texture type");
60 }
61}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
@ kTextureExternalSampler
@ kTexture2DSampler
@ kTexture2DRectSampler
GLenum type