Flutter Engine
The Flutter Engine
Functions
GrYUVtoRGBEffect.cpp File Reference
#include "src/gpu/ganesh/effects/GrYUVtoRGBEffect.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRect.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkYUVAInfo.h"
#include "include/private/SkSLSampleUsage.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTo.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/core/SkSLTypeShared.h"
#include "src/core/SkYUVAInfoLocation.h"
#include "src/core/SkYUVMath.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrYUVATextureProxies.h"
#include "src/gpu/ganesh/effects/GrMatrixEffect.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <string>
#include <utility>

Go to the source code of this file.

Functions

static void border_colors (const GrYUVATextureProxies &yuvaProxies, float planeBorders[4][4])
 
static SkAlphaType alpha_type (const SkYUVAInfo::YUVALocations locations)
 

Function Documentation

◆ alpha_type()

static SkAlphaType alpha_type ( const SkYUVAInfo::YUVALocations  locations)
static

Definition at line 221 of file GrYUVtoRGBEffect.cpp.

221 {
222 return locations[SkYUVAInfo::YUVAChannels::kA].fPlane >= 0 ? kPremul_SkAlphaType
224}
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
const auto kA

◆ border_colors()

static void border_colors ( const GrYUVATextureProxies yuvaProxies,
float  planeBorders[4][4] 
)
static

Definition at line 40 of file GrYUVtoRGBEffect.cpp.

40 {
41 float m[20];
43 for (int i = 0; i < SkYUVAInfo::kYUVAChannelCount; ++i) {
44 auto [plane, channel] = yuvaProxies.yuvaLocations()[i];
45 if (plane == -1) {
46 return;
47 }
48 auto c = static_cast<int>(channel);
49 planeBorders[plane][c] = m[i*5 + 4];
50 }
51}
void SkColorMatrix_RGB2YUV(SkYUVColorSpace cs, float m[20])
Definition: SkYUVMath.cpp:389
const SkYUVAInfo & yuvaInfo() const
const SkYUVAInfo::YUVALocations & yuvaLocations() const
SkYUVColorSpace yuvColorSpace() const
Definition: SkYUVAInfo.h:175
static constexpr int kYUVAChannelCount
Definition: SkYUVAInfo.h:29