/third_party/skia/include/core/ |
H A D | SkMatrix.h | 32 /** \class SkMatrix 33 SkMatrix holds a 3x3 matrix for transforming coordinates. This allows mapping 37 SkMatrix elements are in row major order. 38 SkMatrix constexpr default constructs to identity. 40 SkMatrix includes a hidden variable that classifies the type of matrix to 41 improve performance. SkMatrix is not thread safe unless getType() is called first. 46 class SK_API SkMatrix { class 49 /** Creates an identity SkMatrix: 55 constexpr SkMatrix() : SkMatrix( function in SkMatrix 1862 constexpr SkMatrix(SkScalar sx, SkScalar kx, SkScalar tx, SkMatrix() function in SkMatrix [all...] |
/third_party/skia/src/core/ |
H A D | SkMatrix.cpp | 8 #include "include/core/SkMatrix.h" 24 void SkMatrix::doNormalizePerspective() { in doNormalizePerspective() 30 if (0 == fMat[SkMatrix::kMPersp0] && 0 == fMat[SkMatrix::kMPersp1]) { in doNormalizePerspective() 31 SkScalar p2 = fMat[SkMatrix::kMPersp2]; in doNormalizePerspective() 37 fMat[SkMatrix::kMPersp2] = 1; in doNormalizePerspective() 63 SkMatrix& SkMatrix::reset() { *this = SkMatrix(); return *this; } in reset() 65 SkMatrix [all...] |
H A D | SkMatrixPriv.h | 12 #include "include/core/SkMatrix.h" 23 static size_t WriteToMemory(const SkMatrix& matrix, void* buffer) { in WriteToMemory() 27 static size_t ReadFromMemory(SkMatrix* matrix, const void* buffer, size_t length) { in ReadFromMemory() 31 typedef SkMatrix::MapXYProc MapXYProc; 32 typedef SkMatrix::MapPtsProc MapPtsProc; 35 static MapPtsProc GetMapPtsProc(const SkMatrix& matrix) { in GetMapPtsProc() 36 return SkMatrix::GetMapPtsProc(matrix.getType()); in GetMapPtsProc() 39 static MapXYProc GetMapXYProc(const SkMatrix& matrix) { in GetMapXYProc() 40 return SkMatrix::GetMapXYProc(matrix.getType()); in GetMapXYProc() 47 static bool SK_WARN_UNUSED_RESULT InverseMapRect(const SkMatrix [all...] |
H A D | SkImageFilterTypes.cpp | 8 #include "include/core/SkMatrix.h" 15 static SkIVector map_as_vector(int32_t x, int32_t y, const SkMatrix& matrix) { in map_as_vector() 21 static SkVector map_as_vector(SkScalar x, SkScalar y, const SkMatrix& matrix) { in map_as_vector() 29 bool Mapping::decomposeCTM(const SkMatrix& ctm, const SkImageFilter* filter, in decomposeCTM() 31 SkMatrix remainder, layer; in decomposeCTM() 39 layer = SkMatrix::I(); in decomposeCTM() 43 remainder = SkMatrix::I(); in decomposeCTM() 48 layer = SkMatrix::Scale(decomposed.fWidth, decomposed.fHeight); in decomposeCTM() 65 layer = SkMatrix::Scale(scale, scale); in decomposeCTM() 68 SkMatrix invRemainde in decomposeCTM() [all...] |
/third_party/skia/src/shaders/ |
H A D | SkShaderBase.h | 11 #include "include/core/SkMatrix.h" 42 sk_sp<SkShader> makeWithCTM(const SkMatrix&) const; // owns its own ctm 50 const SkMatrix& getLocalMatrix() const { return fLocalMatrix; } in getLocalMatrix() 72 ContextRec(const SkPaint& paint, const SkMatrix& matrix, const SkMatrix* localM, in ContextRec() 82 const SkMatrix* fMatrix; // the current matrix in the canvas 83 const SkMatrix* fLocalMatrix; // optional local matrix 119 const SkMatrix& getTotalInverse() const { return fTotalInverse; } in getTotalInverse() 120 const SkMatrix& getCTM() const { return fCTM; } in getCTM() 123 SkMatrix fCT [all...] |
H A D | SkLocalMatrixShader.cpp | 27 SkMatrix lm; in CreateProc() 45 SkTCopyOnFirstWrite<SkMatrix> lm(this->getLocalMatrix()); in onMakeContext() 57 SkImage* SkLocalMatrixShader::onIsAImage(SkMatrix* outMatrix, SkTileMode* mode) const { in onIsAImage() 58 SkMatrix imageMatrix; in onIsAImage() 62 *outMatrix = SkMatrix::Concat(imageMatrix, this->getLocalMatrix()); in onIsAImage() 69 SkTCopyOnFirstWrite<SkMatrix> lm(this->getLocalMatrix()); in onAppendStages() 82 const SkMatrixProvider& matrices, const SkMatrix* localM, in onProgram() 85 SkTCopyOnFirstWrite<SkMatrix> lm(this->getLocalMatrix()); in onProgram() 94 sk_sp<SkShader> SkShader::makeWithLocalMatrix(const SkMatrix& localMatrix) const { in makeWithLocalMatrix() 99 const SkMatrix* l in makeWithLocalMatrix() [all...] |
/third_party/skia/modules/sksg/src/ |
H A D | SkSGTransform.cpp | 18 SkMatrix AsSkMatrix(const T&); 21 SkMatrix AsSkMatrix<SkMatrix>(const SkMatrix& m) { return m; } in AsSkMatrix() 24 SkMatrix AsSkMatrix<SkM44>(const SkM44& m) { return m.asM33(); } in AsSkMatrix() 30 SkM44 AsSkM44<SkMatrix>(const SkMatrix& m) { return SkM44(m); } in AsSkM44() 38 template <typename = std::enable_if<std::is_same<T, SkMatrix>::value || 55 SkRect onRevalidate(InvalidationController* ic, const SkMatrix& ctm) override { 66 SkMatrix asMatri [all...] |
/third_party/skia/src/gpu/glsl/ |
H A D | GrGLSLProgramDataManager.cpp | 11 #include "include/core/SkMatrix.h" 14 void GrGLSLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) const { in setSkMatrix() 16 matrix.get(SkMatrix::kMScaleX), in setSkMatrix() 17 matrix.get(SkMatrix::kMSkewY), in setSkMatrix() 18 matrix.get(SkMatrix::kMPersp0), in setSkMatrix() 19 matrix.get(SkMatrix::kMSkewX), in setSkMatrix() 20 matrix.get(SkMatrix::kMScaleY), in setSkMatrix() 21 matrix.get(SkMatrix::kMPersp1), in setSkMatrix() 22 matrix.get(SkMatrix::kMTransX), in setSkMatrix() 23 matrix.get(SkMatrix in setSkMatrix() [all...] |
/third_party/skia/docs/examples/ |
H A D | MemberIndex.cpp | 14 for (int i : { SkMatrix::kMScaleX, SkMatrix::kMSkewX, SkMatrix::kMTransX, in REG_FIDDLE() 15 SkMatrix::kMSkewY, SkMatrix::kMScaleY, SkMatrix::kMTransY, in REG_FIDDLE() 16 SkMatrix::kMPersp0, SkMatrix::kMPersp1, SkMatrix::kMPersp2 } ) { in REG_FIDDLE() 17 SkMatrix in REG_FIDDLE() [all...] |
H A D | Matrix_TypeMask.cpp | 7 auto debugster = [](const char* prefix, const SkMatrix& matrix) -> void { in REG_FIDDLE() 9 typeMask += SkMatrix::kIdentity_Mask == matrix.getType() ? "kIdentity_Mask " : ""; in REG_FIDDLE() 10 typeMask += SkMatrix::kTranslate_Mask & matrix.getType() ? "kTranslate_Mask " : ""; in REG_FIDDLE() 11 typeMask += SkMatrix::kScale_Mask & matrix.getType() ? "kScale_Mask " : ""; in REG_FIDDLE() 12 typeMask += SkMatrix::kAffine_Mask & matrix.getType() ? "kAffine_Mask " : ""; in REG_FIDDLE() 13 typeMask += SkMatrix::kPerspective_Mask & matrix.getType() ? "kPerspective_Mask" : ""; in REG_FIDDLE() 16 SkMatrix matrix; in REG_FIDDLE()
|
/third_party/skia/include/codec/ |
H A D | SkEncodedOrigin.h | 11 #include "include/core/SkMatrix.h" 32 static inline SkMatrix SkEncodedOriginToMatrix(SkEncodedOrigin origin, int w, int h) { in SkEncodedOriginToMatrix() 34 case kTopLeft_SkEncodedOrigin: return SkMatrix::I(); in SkEncodedOriginToMatrix() 35 case kTopRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, 1, 0, 0, 0, 1); in SkEncodedOriginToMatrix() 36 case kBottomRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, -1, h, 0, 0, 1); in SkEncodedOriginToMatrix() 37 case kBottomLeft_SkEncodedOrigin: return SkMatrix::MakeAll( 1, 0, 0, 0, -1, h, 0, 0, 1); in SkEncodedOriginToMatrix() 38 case kLeftTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, 1, 0, 0, 0, 0, 1); in SkEncodedOriginToMatrix() 39 case kRightTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, w, 1, 0, 0, 0, 0, 1); in SkEncodedOriginToMatrix() 40 case kRightBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, w, -1, 0, h, 0, 0, 1); in SkEncodedOriginToMatrix() 41 case kLeftBottom_SkEncodedOrigin: return SkMatrix in SkEncodedOriginToMatrix() [all...] |
/third_party/skia/src/utils/ |
H A D | SkCamera.cpp | 84 SkMatrix* orien = &fOrientation; in doUpdate() 101 orien->set(SkMatrix::kMScaleX, x * axis.x - z * cross.x); in doUpdate() 102 orien->set(SkMatrix::kMSkewX, x * axis.y - z * cross.y); in doUpdate() 103 orien->set(SkMatrix::kMTransX, x * axis.z - z * cross.z); in doUpdate() 104 orien->set(SkMatrix::kMSkewY, y * axis.x - z * zenith.x); in doUpdate() 105 orien->set(SkMatrix::kMScaleY, y * axis.y - z * zenith.y); in doUpdate() 106 orien->set(SkMatrix::kMTransY, y * axis.z - z * zenith.z); in doUpdate() 107 orien->set(SkMatrix::kMPersp0, axis.x); in doUpdate() 108 orien->set(SkMatrix::kMPersp1, axis.y); in doUpdate() 109 orien->set(SkMatrix in doUpdate() [all...] |
/third_party/skia/src/gpu/v1/ |
H A D | SurfaceDrawContext_v1.h | 47 class SkMatrix; 145 void drawPaint(const GrClip*, GrPaint&&, const SkMatrix& viewMatrix); 159 const SkMatrix& viewMatrix, 168 * @param SkMatrix transformation matrix which applies to rectToDraw 175 const SkMatrix&, 185 const SkMatrix& localMatrix) { in fillPixelsWithLocalMatrix() 187 DrawQuad quad{GrQuad::MakeFromRect(rect, SkMatrix::I()), in fillPixelsWithLocalMatrix() 199 const SkMatrix& viewMatrix, const SkRect& rect, in fillRectWithEdgeAA() 224 const SkMatrix& viewMatrix, const SkPoint points[4], in fillQuadWithEdgeAA() 228 GrQuad::MakeFromSkQuad(localPoints, SkMatrix in fillQuadWithEdgeAA() [all...] |
/third_party/skia/tests/ |
H A D | GrQuadCropTest.cpp | 25 const SkMatrix& viewMatrix, const SkMatrix* localMatrix) { in run_crop_axis_aligned_test() 30 GrQuad::MakeFromRect(kDrawRect, localMatrix ? *localMatrix : SkMatrix::I()), in run_crop_axis_aligned_test() 49 SkMatrix invViewMatrix; in run_crop_axis_aligned_test() 53 SkMatrix toLocal = SkMatrix::Concat(*localMatrix, invViewMatrix); in run_crop_axis_aligned_test() 99 const SkMatrix& viewMatrix, const SkMatrix* localMatrix) { in run_crop_fully_covered_test() 105 SkMatrix invViewMatrix; in run_crop_fully_covered_test() 113 GrQuad::MakeFromRect(drawRect, localMatrix ? *localMatrix : SkMatrix in run_crop_fully_covered_test() [all...] |
H A D | MatrixTest.cpp | 20 static bool nearly_equal(const SkMatrix& a, const SkMatrix& b) { in nearly_equal() 37 const SkMatrix& a, in are_equal() 38 const SkMatrix& b) { in are_equal() 75 static bool is_identity(const SkMatrix& m) { in is_identity() 76 SkMatrix identity; in is_identity() 81 static void assert9(skiatest::Reporter* reporter, const SkMatrix& m, in assert9() 110 SkMatrix m; in test_set9() 122 buffer[SkMatrix::kMScaleX] = 1; in test_set9() 123 buffer[SkMatrix in test_set9() [all...] |
H A D | ClipStackTest.cpp | 11 #include "include/core/SkMatrix.h" 49 s.clipPath(p, SkMatrix::I(), SkClipOp::kIntersect, doAA); in test_assign_and_comparison() 55 s.clipRect(r, SkMatrix::I(), SkClipOp::kIntersect, doAA); in test_assign_and_comparison() 57 s.clipRect(r, SkMatrix::I(), SkClipOp::kIntersect, doAA); in test_assign_and_comparison() 63 s.clipRect(r, SkMatrix::I(), SkClipOp::kDifference, doAA); in test_assign_and_comparison() 78 s.clipRect(r, SkMatrix::I(), SkClipOp::kDifference, doAA); in test_assign_and_comparison() 87 s.clipRect(r, SkMatrix::I(), SkClipOp::kIntersect, doAA); in test_assign_and_comparison() 95 s.clipPath(rp, SkMatrix::I(), SkClipOp::kDifference, doAA); in test_assign_and_comparison() 105 s.clipRect(r, SkMatrix::I(), SkClipOp::kDifference, doAA); in test_assign_and_comparison() 127 s.clipPath(p, SkMatrix in test_assign_and_comparison() [all...] |
H A D | CullTestTest.cpp | 15 const SkMatrix gMatrices[] = { 16 SkMatrix::I(), 17 SkMatrix::Translate(25, -1000), 18 SkMatrix::Scale(.5f, 1000.1f), 19 SkMatrix::MakeAll(1000.1f, .0f, -100, 22 SkMatrix::MakeAll(0, 1, 0, 25 SkMatrix::MakeAll( 2, 7.0f, -100, 38 for (SkMatrix m : gMatrices) { in DEF_TEST() 40 SkMatrix inverse; in DEF_TEST()
|
/third_party/skia/src/gpu/effects/ |
H A D | GrBezierEffect.h | 63 const SkMatrix& viewMatrix, in Make() 65 const SkMatrix& localMatrix, in Make() 91 GrConicEffect(const SkPMColor4f&, const SkMatrix& viewMatrix, uint8_t coverage, 92 const SkMatrix& localMatrix, bool usesLocalCoords); 98 SkMatrix fViewMatrix; 99 SkMatrix fLocalMatrix; 127 const SkMatrix& viewMatrix, 129 const SkMatrix& localMatrix, 155 GrQuadEffect(const SkPMColor4f&, const SkMatrix& viewMatrix, uint8_t coverage, 156 const SkMatrix [all...] |
/third_party/skia/gm/ |
H A D | rsxtext.cpp | 62 {0, 0}, SkMatrix::I(), SkMatrix::I()); 64 {kSZ*1.1f, 0}, SkMatrix::Scale(2, 2), SkMatrix::I()); 66 {0, kSZ*1.1f}, SkMatrix::I(), SkMatrix::RotateDeg(45)); 68 {kSZ*1.1f, kSZ*1.1f}, SkMatrix::Scale(2, 2), SkMatrix::RotateDeg(45)); 71 void draw_one(SkCanvas* canvas, SkPoint pos, const SkMatrix& lm, in draw_one() 72 const SkMatrix in draw_one() [all...] |
H A D | runtimeimagefilter.cpp | 43 auto draw_layer = [&](SkScalar tx, SkScalar ty, SkMatrix m) { in DEF_SIMPLE_GM_BG() 64 draw_layer( 0, 0, SkMatrix::I()); in DEF_SIMPLE_GM_BG() 65 draw_layer(250, 0, SkMatrix::Scale(0.5f, 0.5f)); in DEF_SIMPLE_GM_BG() 66 draw_layer( 0, 250, SkMatrix::RotateDeg(45, {125, 125})); in DEF_SIMPLE_GM_BG() 67 draw_layer(250, 250, SkMatrix::Scale(0.5f, 0.5f) * SkMatrix::RotateDeg(45, {125, 125})); in DEF_SIMPLE_GM_BG() 68 draw_layer( 0, 500, SkMatrix::Skew(-0.5f, 0)); in DEF_SIMPLE_GM_BG() 69 SkMatrix p = SkMatrix::I(); in DEF_SIMPLE_GM_BG()
|
H A D | localmatrixshader.cpp | 15 #include "include/core/SkMatrix.h" 50 const SkMatrix& inner, in DEF_SIMPLE_GM() 51 const SkMatrix& outer); in DEF_SIMPLE_GM() 54 [](const sk_sp<SkImage>& img, const SkMatrix& inner, const SkMatrix& outer) { in DEF_SIMPLE_GM() 59 [](const sk_sp<SkImage>& img, const SkMatrix& inner, const SkMatrix& outer) { in DEF_SIMPLE_GM() 64 [](const sk_sp<SkImage>& img, const SkMatrix& inner, const SkMatrix& outer) { in DEF_SIMPLE_GM() 72 [](const sk_sp<SkImage>& img, const SkMatrix in DEF_SIMPLE_GM() [all...] |
/third_party/skia/bench/ |
H A D | DrawBitmapAABench.cpp | 10 #include "include/core/SkMatrix.h" 22 DrawBitmapAABench(bool doAA, const SkMatrix& matrix, const char name[]) in DrawBitmapAABench() 51 SkMatrix fMatrix; 58 DEF_BENCH( return new DrawBitmapAABench(false, SkMatrix::I(), "ident"); ) 60 DEF_BENCH( return new DrawBitmapAABench(false, SkMatrix::Scale(1.17f, 1.17f), "scale"); ) 62 DEF_BENCH( return new DrawBitmapAABench(false, SkMatrix::Translate(17.5f, 17.5f), "translate"); ) 65 SkMatrix m; 71 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::I(), "ident"); ) 73 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::Scale(1.17f, 1.17f), "scale"); ) 75 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix [all...] |
/third_party/skia/src/gpu/geometry/ |
H A D | GrQuad.cpp | 10 #include "include/core/SkMatrix.h" 18 static void map_rect_translate_scale(const SkRect& rect, const SkMatrix& m, in map_rect_translate_scale() 20 SkMatrix::TypeMask tm = m.getType(); in map_rect_translate_scale() 21 SkASSERT(tm <= (SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask)); in map_rect_translate_scale() 24 if (tm > SkMatrix::kIdentity_Mask) { in map_rect_translate_scale() 26 if (tm <= SkMatrix::kTranslate_Mask) { in map_rect_translate_scale() 37 static void map_quad_general(const V4f& qx, const V4f& qy, const SkMatrix& m, in map_quad_general() 42 V4f w = m.getPerspX() * qx + (m.getPerspY() * qy + m.get(SkMatrix::kMPersp2)); in map_quad_general() 57 static void map_rect_general(const SkRect& rect, const SkMatrix [all...] |
/third_party/skia/src/gpu/ |
H A D | GrDefaultGeoProcFactory.cpp | 39 const SkMatrix& viewMatrix, in Make() 40 const SkMatrix& localMatrix, in Make() 69 usesLocalMatrix ? fLocalMatrix : SkMatrix::I()); 196 SkMatrix fViewMatrixPrev = SkMatrix::InvalidMatrix(); 197 SkMatrix fLocalMatrixPrev = SkMatrix::InvalidMatrix(); 212 const SkMatrix& viewMatrix, in DefaultGeoProc() 213 const SkMatrix& localMatrix, in DefaultGeoProc() 243 SkMatrix fViewMatri [all...] |
/third_party/skia/src/gpu/ops/ |
H A D | SoftwarePathRenderer.cpp | 40 SoftwarePathData(const SkIRect& maskBounds, const SkMatrix& viewMatrix, in SoftwarePathData() 48 const SkMatrix* getViewMatrix() const { return &fViewMatrix; } in getViewMatrix() 54 SkMatrix fViewMatrix; 59 bool get_unclipped_shape_dev_bounds(const GrStyledShape& shape, const SkMatrix& matrix, in get_unclipped_shape_dev_bounds() 125 const SkMatrix& matrix, in GetShapeAndClipBounds() 151 const SkMatrix& viewMatrix, in DrawNonAARect() 153 const SkMatrix& localMatrix) { in DrawNonAARect() 162 const SkMatrix& viewMatrix, in DrawAroundInvPath() 165 SkMatrix invert; in DrawAroundInvPath() 175 SkMatrix in DrawAroundInvPath() [all...] |