Skip to content

Commit

Permalink
Rename 'localMatrix' file and function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fjie committed Sep 20, 2024
1 parent 0c45523 commit 458b3a3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/images/FilterImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "gpu/processors/FragmentProcessor.h"
#include "gpu/processors/TiledTextureEffect.h"
#include "gpu/proxies/RenderTargetProxy.h"
#include "utils/LocalMatrix.h"
#include "utils/UVMatrix.h"

namespace tgfx {
std::shared_ptr<Image> FilterImage::MakeFrom(std::shared_ptr<Image> source,
Expand Down Expand Up @@ -114,7 +114,7 @@ std::unique_ptr<FragmentProcessor> FilterImage::asFragmentProcessor(const FPArgs
TileMode tileModeY,
const SamplingOptions& sampling,
const Matrix* uvMatrix) const {
auto fpMatrix = LocalMatrix::Concat(bounds, uvMatrix);
auto fpMatrix = UVMatrix::Concat(bounds, uvMatrix);

auto inputBounds = Rect::MakeWH(source->width(), source->height());
auto drawBounds = args.drawRect;
Expand Down
4 changes: 2 additions & 2 deletions src/images/OrientImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ std::unique_ptr<FragmentProcessor> OrientImage::asFragmentProcessor(const FPArgs
TileMode tileModeY,
const SamplingOptions& sampling,
const Matrix* uvMatrix) const {
auto matrix = concatLocalMatrix(uvMatrix);
auto matrix = concatUVMatrix(uvMatrix);
return FragmentProcessor::Make(source, args, tileModeX, tileModeY, sampling, AddressOf(matrix));
}

std::optional<Matrix> OrientImage::concatLocalMatrix(const Matrix* uvMatrix) const {
std::optional<Matrix> OrientImage::concatUVMatrix(const Matrix* uvMatrix) const {
std::optional<Matrix> matrix = std::nullopt;
if (orientation != Orientation::TopLeft) {
matrix = OrientationToMatrix(orientation, source->width(), source->height());
Expand Down
2 changes: 1 addition & 1 deletion src/images/OrientImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class OrientImage : public TransformImage {
const SamplingOptions& sampling,
const Matrix* uvMatrix) const override;

virtual std::optional<Matrix> concatLocalMatrix(const Matrix* uvMatrix) const;
virtual std::optional<Matrix> concatUVMatrix(const Matrix* uvMatrix) const;

Orientation concatOrientation(Orientation newOrientation) const;
};
Expand Down
2 changes: 1 addition & 1 deletion src/images/RGBAAAImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::unique_ptr<FragmentProcessor> RGBAAAImage::asFragmentProcessor(const FPArgs
const SamplingOptions& sampling,
const Matrix* uvMatrix) const {
auto proxy = source->lockTextureProxy(args.context, args.renderFlags);
auto matrix = concatLocalMatrix(uvMatrix);
auto matrix = concatUVMatrix(uvMatrix);
return TextureEffect::MakeRGBAAA(std::move(proxy), alphaStart, sampling, AddressOf(matrix));
}
} // namespace tgfx
8 changes: 4 additions & 4 deletions src/images/SubsetImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "SubsetImage.h"
#include "utils/LocalMatrix.h"
#include "utils/UVMatrix.h"

namespace tgfx {
std::shared_ptr<Image> SubsetImage::MakeFrom(std::shared_ptr<Image> source, Orientation orientation,
Expand Down Expand Up @@ -57,8 +57,8 @@ std::shared_ptr<Image> SubsetImage::onMakeOriented(Orientation orientation) cons
return SubsetImage::MakeFrom(source, newOrientation, newBounds);
}

std::optional<Matrix> SubsetImage::concatLocalMatrix(const Matrix* uvMatrix) const {
auto matrix = LocalMatrix::Concat(bounds, uvMatrix);
return OrientImage::concatLocalMatrix(AddressOf(matrix));
std::optional<Matrix> SubsetImage::concatUVMatrix(const Matrix* uvMatrix) const {
auto matrix = UVMatrix::Concat(bounds, uvMatrix);
return OrientImage::concatUVMatrix(AddressOf(matrix));
}
} // namespace tgfx
2 changes: 1 addition & 1 deletion src/images/SubsetImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SubsetImage : public OrientImage {

std::shared_ptr<Image> onMakeOriented(Orientation orientation) const override;

std::optional<Matrix> concatLocalMatrix(const Matrix* uvMatrix) const override;
std::optional<Matrix> concatUVMatrix(const Matrix* uvMatrix) const override;

SubsetImage(std::shared_ptr<Image> source, Orientation orientation, const Rect& bounds);
};
Expand Down
4 changes: 2 additions & 2 deletions src/utils/LocalMatrix.cpp → src/utils/UVMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
//
/////////////////////////////////////////////////////////////////////////////////////////////////

#include "LocalMatrix.h"
#include "UVMatrix.h"

namespace tgfx {
std::optional<Matrix> LocalMatrix::Concat(const Rect& subset, const Matrix* uvMatrix) {
std::optional<Matrix> UVMatrix::Concat(const Rect& subset, const Matrix* uvMatrix) {
std::optional<Matrix> matrix = std::nullopt;
if (subset.x() != 0 || subset.y() != 0) {
matrix = Matrix::MakeTrans(subset.x(), subset.y());
Expand Down
2 changes: 1 addition & 1 deletion src/utils/LocalMatrix.h → src/utils/UVMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "tgfx/core/Matrix.h"

namespace tgfx {
class LocalMatrix {
class UVMatrix {
public:
static std::optional<Matrix> Concat(const Rect& subset, const Matrix* uvMatrix);
};
Expand Down

0 comments on commit 458b3a3

Please sign in to comment.