Flutter Engine
The Flutter Engine
Functions
SkMagnifierImageFilter.cpp File Reference
#include "include/effects/SkImageFilters.h"
#include "include/core/SkFlattenable.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkM44.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkSpan.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkRuntimeEffect.h"
#include "include/private/base/SkFloatingPoint.h"
#include "src/core/SkImageFilterTypes.h"
#include "src/core/SkImageFilter_Base.h"
#include "src/core/SkKnownRuntimeEffects.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h"
#include <algorithm>
#include <optional>
#include <utility>

Go to the source code of this file.

Functions

void SkRegisterMagnifierImageFilterFlattenable ()
 
static sk_sp< SkShadermake_magnifier_shader (sk_sp< SkShader > input, const skif::LayerSpace< SkRect > &lensBounds, const skif::LayerSpace< SkMatrix > &zoomXform, const skif::LayerSpace< SkSize > &inset)
 

Function Documentation

◆ make_magnifier_shader()

static sk_sp< SkShader > make_magnifier_shader ( sk_sp< SkShader input,
const skif::LayerSpace< SkRect > &  lensBounds,
const skif::LayerSpace< SkMatrix > &  zoomXform,
const skif::LayerSpace< SkSize > &  inset 
)
static

Definition at line 142 of file SkMagnifierImageFilter.cpp.

146 {
147 const SkRuntimeEffect* magEffect =
148 GetKnownRuntimeEffect(SkKnownRuntimeEffects::StableKey::kMagnifier);
149
151 builder.child("src") = std::move(input);
152
153 SkASSERT(inset.width() > 0.f && inset.height() > 0.f);
154 builder.uniform("lensBounds") = SkRect(lensBounds);
155 builder.uniform("zoomXform") = SkV4{/*Tx*/zoomXform.rc(0, 2), /*Ty*/zoomXform.rc(1, 2),
156 /*Sx*/zoomXform.rc(0, 0), /*Sy*/zoomXform.rc(1, 1)};
157 builder.uniform("invInset") = SkV2{1.f / inset.width(),
158 1.f / inset.height()};
159
160 return builder.makeShader();
161}
#define SkASSERT(cond)
Definition: SkAssert.h:116
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
float rc(int row, int col) const
const SkRuntimeEffect * GetKnownRuntimeEffect(StableKey stableKey)
static SkRect inset(const SkRect &r)
constexpr float height() const
Definition: SkRect.h:769
constexpr float width() const
Definition: SkRect.h:762
Definition: SkM44.h:19
Definition: SkM44.h:98

◆ SkRegisterMagnifierImageFilterFlattenable()

void SkRegisterMagnifierImageFilterFlattenable ( )

Definition at line 110 of file SkMagnifierImageFilter.cpp.

110 {
111 SK_REGISTER_FLATTENABLE(SkMagnifierImageFilter);
112}
#define SK_REGISTER_FLATTENABLE(type)