Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DM::ViaUpright Class Reference

#include <DMSrcSink.h>

Inheritance diagram for DM::ViaUpright:
DM::Via DM::Sink

Public Member Functions

 ViaUpright (SkMatrix, Sink *)
 
Result draw (const Src &, SkBitmap *, SkWStream *, SkString *) const override
 
- Public Member Functions inherited from DM::Via
 Via (Sink *sink)
 
const char * fileExtension () const override
 
bool serial () const override
 
SinkFlags flags () const override
 
void setColorSpace (sk_sp< SkColorSpace > colorSpace) override
 
- Public Member Functions inherited from DM::Sink
virtual ~Sink ()
 
virtual SkColorInfo colorInfo () const
 

Additional Inherited Members

- Protected Attributes inherited from DM::Via
std::unique_ptr< SinkfSink
 

Detailed Description

Definition at line 655 of file DMSrcSink.h.

Constructor & Destructor Documentation

◆ ViaUpright()

DM::ViaUpright::ViaUpright ( SkMatrix  matrix,
Sink sink 
)

Definition at line 2490 of file DMSrcSink.cpp.

2490: Via(sink), fMatrix(matrix) {}
Via(Sink *sink)
Definition DMSrcSink.h:631

Member Function Documentation

◆ draw()

Result DM::ViaUpright::draw ( const Src src,
SkBitmap bitmap,
SkWStream stream,
SkString log 
) const
overridevirtual

Implements DM::Sink.

Definition at line 2492 of file DMSrcSink.cpp.

2492 {
2493 Result result = fSink->draw(src, bitmap, stream, log);
2494 if (!result.isOk()) {
2495 return result;
2496 }
2497
2498 SkMatrix inverse;
2499 if (!fMatrix.rectStaysRect() || !fMatrix.invert(&inverse)) {
2500 return Result::Fatal("Cannot upright --matrix.");
2501 }
2502 SkMatrix upright = SkMatrix::I();
2503 upright.setScaleX(SkScalarSignAsScalar(inverse.getScaleX()));
2504 upright.setScaleY(SkScalarSignAsScalar(inverse.getScaleY()));
2505 upright.setSkewX(SkScalarSignAsScalar(inverse.getSkewX()));
2506 upright.setSkewY(SkScalarSignAsScalar(inverse.getSkewY()));
2507
2508 SkBitmap uprighted;
2509 SkISize size = auto_compute_translate(&upright, bitmap->width(), bitmap->height());
2510 uprighted.allocPixels(bitmap->info().makeDimensions(size));
2511
2512 SkCanvas canvas(uprighted);
2513 canvas.concat(upright);
2514 SkPaint paint;
2515 paint.setBlendMode(SkBlendMode::kSrc);
2516 canvas.drawImage(bitmap->asImage(), 0, 0, SkSamplingOptions(), &paint);
2517
2518 *bitmap = uprighted;
2519 return Result::Ok();
2520}
static SkScalar SkScalarSignAsScalar(SkScalar x)
Definition SkScalar.h:95
static Result Ok()
Definition DMSrcSink.h:50
std::unique_ptr< Sink > fSink
Definition DMSrcSink.h:643
void allocPixels(const SkImageInfo &info, size_t rowBytes)
Definition SkBitmap.cpp:258
SkScalar getSkewY() const
Definition SkMatrix.h:430
SkMatrix & setSkewX(SkScalar v)
Definition SkMatrix.h:518
SkScalar getSkewX() const
Definition SkMatrix.h:438
bool invert(SkMatrix *inverse) const
Definition SkMatrix.h:1206
bool rectStaysRect() const
Definition SkMatrix.h:271
SkScalar getScaleX() const
Definition SkMatrix.h:415
static const SkMatrix & I()
SkScalar getScaleY() const
Definition SkMatrix.h:422
SkMatrix & setScaleY(SkScalar v)
Definition SkMatrix.h:506
SkMatrix & setSkewY(SkScalar v)
Definition SkMatrix.h:512
SkMatrix & setScaleX(SkScalar v)
Definition SkMatrix.h:500
const Paint & paint
GAsyncResult * result
static SkISize auto_compute_translate(SkMatrix *matrix, int srcW, int srcH)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

The documentation for this class was generated from the following files: