Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
fpcoordinateoverride.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "src/core/SkCanvasPriv.h"
#include "src/gpu/ganesh/GrCanvas.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/SkGr.h"
#include "src/gpu/ganesh/SurfaceFillContext.h"
#include "src/gpu/ganesh/effects/GrSkSLFP.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "tools/DecodeUtils.h"
#include "tools/Resources.h"
#include "tools/ToolUtils.h"

Go to the source code of this file.

Classes

class  SampleCoordEffect
 

Functions

 DEF_SIMPLE_GPU_GM_BG (fpcoordinateoverride, rContext, canvas, 512, 512, ToolUtils::color_to_565(0xFF66AA99))
 

Function Documentation

◆ DEF_SIMPLE_GPU_GM_BG()

DEF_SIMPLE_GPU_GM_BG ( fpcoordinateoverride  ,
rContext  ,
canvas  ,
512  ,
512  ,
ToolUtils::color_to_565(0xFF66AA99)   
)

Definition at line 77 of file fpcoordinateoverride.cpp.

78 {
79
81 if (!sfc) {
82 return;
83 }
84
85 SkBitmap bmp;
86 ToolUtils::GetResourceAsBitmap("images/mandrill_512_q075.jpg", &bmp);
87 auto view = std::get<0>(GrMakeCachedBitmapProxyView(
88 rContext, bmp, /*label=*/"FpCoordinateOverride", skgpu::Mipmapped::kNo));
89 if (!view) {
90 return;
91 }
92 std::unique_ptr<GrFragmentProcessor> imgFP =
93 GrTextureEffect::Make(std::move(view), bmp.alphaType(), SkMatrix());
94 auto fp = std::unique_ptr<GrFragmentProcessor>(new SampleCoordEffect(std::move(imgFP)));
95
96 sfc->fillWithFP(std::move(fp));
97}
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeCachedBitmapProxyView(GrRecordingContext *rContext, const SkBitmap &bitmap, std::string_view label, skgpu::Mipmapped mipmapped)
Definition SkGr.cpp:188
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone)
SkAlphaType alphaType() const
Definition SkBitmap.h:162
bool GetResourceAsBitmap(const char *resource, SkBitmap *dst)
Definition DecodeUtils.h:21
const uint32_t fp
SurfaceFillContext * TopDeviceSurfaceFillContext(const SkCanvas *canvas)
Definition GrCanvas.cpp:27