mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Painter: Minor optimizations
git-svn-id: svn://ultimatepp.org/upp/trunk@12462 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
db4914dc6d
commit
1c13aee8d4
4 changed files with 5 additions and 15 deletions
|
|
@ -148,7 +148,7 @@ Image RescaleFilter(const Image& img, int cx, int cy,
|
|||
|
||||
static double sNearest(double x)
|
||||
{
|
||||
return x >= -0.5 && x <= 0.5;
|
||||
return (double)(x >= -0.5 && x <= 0.5);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@ INITIALIZE(PaintPainting)
|
|||
struct Xform2D {
|
||||
Pointf x, y, t;
|
||||
|
||||
Pointf Transform(double px, double py) const { return Pointf(px * x.x + py * x.y + t.x, px * y.x + py * y.y + t.y); }
|
||||
Pointf Transform(const Pointf& f) const { return Transform(f.x, f.y); }
|
||||
|
||||
Pointf GetScaleXY() const;
|
||||
double GetScale() const;
|
||||
bool IsRegular() const;
|
||||
Pointf Transform(const Pointf& f) const;
|
||||
Pointf Transform(double x, double y) const;
|
||||
|
||||
static Xform2D Identity();
|
||||
static Xform2D Translation(double x, double y);
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ Buffer<ClippingLine> BufferPainter::RenderPath(double width, Event<One<SpanSourc
|
|||
job.path_min = path_min;
|
||||
job.path_max = path_max;
|
||||
current = Null;
|
||||
if(jobcount >= 64) {
|
||||
if(jobcount >= 1024) {
|
||||
LDUMP("Finish A");
|
||||
Finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,6 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
Pointf Xform2D::Transform(const Pointf& f) const
|
||||
{
|
||||
PAINTER_TIMING("Transform");
|
||||
return Pointf(f.x * x.x + f.y * x.y + t.x, f.x * y.x + f.y * y.y + t.y);
|
||||
}
|
||||
|
||||
Pointf Xform2D::Transform(double x, double y) const
|
||||
{
|
||||
return Transform(Pointf(x, y));
|
||||
}
|
||||
|
||||
Pointf Xform2D::GetScaleXY() const
|
||||
{
|
||||
return Pointf(sqrt(x.x * x.x + y.x * y.x), sqrt(x.y * x.y + y.y * y.y));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue