Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrUtil.cpp File Reference
#include "src/gpu/ganesh/GrUtil.h"
#include "src/core/SkDrawProcs.h"
#include "src/gpu/ganesh/GrStyle.h"

Go to the source code of this file.

Functions

GrIntelGpuFamily GrGetIntelGpuFamily (uint32_t deviceID)
 
bool GrIsStrokeHairlineOrEquivalent (const GrStyle &style, const SkMatrix &matrix, SkScalar *outCoverage)
 

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}
@ 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

◆ 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)
#define SK_Scalar1
Definition SkScalar.h:18
SkPathEffect * pathEffect() const
Definition GrStyle.h:119
const SkStrokeRec & strokeRec() const
Definition GrStyle.h:140
Style getStyle() const
bool isHairlineStyle() const
Definition SkStrokeRec.h:47
SkScalar getWidth() const
Definition SkStrokeRec.h:42