зеркало из https://github.com/mozilla/moz-skia.git
Fixed minor Release & fixed point compiler warnings on Linux
http://codereview.appspot.com/6118050/ git-svn-id: http://skia.googlecode.com/svn/trunk@3766 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
c1f6621446
Коммит
7460b378d6
|
@ -45,7 +45,7 @@ protected:
|
|||
};
|
||||
SkRandom random;
|
||||
|
||||
for (int i = 0; i < SK_ARRAY_COUNT(gStyles); ++i) {
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(gStyles); ++i) {
|
||||
SkMaskFilter* mf = SkBlurMaskFilter::Create(blurRadius,
|
||||
gStyles[i],
|
||||
SkBlurMaskFilter::kHighQuality_BlurFlag);
|
||||
|
|
|
@ -19,10 +19,11 @@
|
|||
|
||||
static void test_edgeclipper() {
|
||||
SkPoint pts[] = {
|
||||
{ -8.38822452e+21f, -7.69721471e+19f },
|
||||
{ 1.57645875e+23f, 1.44634003e+21f },
|
||||
{ 1.61519691e+23f, 1.48208059e+21f },
|
||||
{ 3.13963584e+23f, 2.88057438e+21f }
|
||||
{ SkFloatToScalar(-8.38822452e+21f),
|
||||
SkFloatToScalar(-7.69721471e+19f) },
|
||||
{ SkFloatToScalar(1.57645875e+23f), SkFloatToScalar(1.44634003e+21f) },
|
||||
{ SkFloatToScalar(1.61519691e+23f), SkFloatToScalar(1.48208059e+21f) },
|
||||
{ SkFloatToScalar(3.13963584e+23f), SkFloatToScalar(2.88057438e+21f) }
|
||||
};
|
||||
SkRect clip = { 0, 0, 300, 200 };
|
||||
|
||||
|
|
|
@ -77,9 +77,12 @@ protected:
|
|||
if (false) {
|
||||
SkPoint pts[4];
|
||||
pts[0].set(1.61061274e+09f, 6291456);
|
||||
pts[1].set(-7.18397061e+15f, -1.53091184e+13f);
|
||||
pts[2].set(-1.30077315e+16f, -2.77196141e+13f);
|
||||
pts[3].set(-1.30077315e+16f, -2.77196162e+13f);
|
||||
pts[1].set(SkFloatToScalar(-7.18397061e+15f),
|
||||
SkFloatToScalar(-1.53091184e+13f));
|
||||
pts[2].set(SkFloatToScalar(-1.30077315e+16f),
|
||||
SkFloatToScalar(-2.77196141e+13f));
|
||||
pts[3].set(SkFloatToScalar(-1.30077315e+16f),
|
||||
SkFloatToScalar(-2.77196162e+13f));
|
||||
|
||||
SkPath path;
|
||||
path.moveTo(pts[0]);
|
||||
|
|
|
@ -1214,7 +1214,7 @@ void SkCanvas::replayClips(ClipVisitor* visitor) const {
|
|||
SkClipStack::B2FIter iter(fClipStack);
|
||||
const SkClipStack::B2FIter::Clip* clip;
|
||||
|
||||
SkRect empty = {};
|
||||
SkRect empty = { 0, 0, 0, 0 };
|
||||
while ((clip = iter.next()) != NULL) {
|
||||
if (clip->fPath) {
|
||||
visitor->clipPath(*clip->fPath, clip->fOp, clip->fDoAA);
|
||||
|
|
|
@ -164,7 +164,7 @@ int num_quad_subdivs(const SkPoint p[3]) {
|
|||
// maybe different when do this using gpu (geo or tess shaders)
|
||||
static const SkScalar gSubdivTol = 175 * SK_Scalar1;
|
||||
|
||||
if (dsqd <= gSubdivTol*gSubdivTol) {
|
||||
if (dsqd <= SkScalarMul(gSubdivTol, gSubdivTol)) {
|
||||
return 0;
|
||||
} else {
|
||||
// subdividing the quad reduces d by 4. so we want x = log4(d/tol)
|
||||
|
@ -177,7 +177,9 @@ int num_quad_subdivs(const SkPoint p[3]) {
|
|||
log = GrMin(GrMax(0, log), kMaxSub);
|
||||
return log;
|
||||
#else
|
||||
SkScalar log = SkScalarLog(SkScalarDiv(dsqd,gSubdivTol*gSubdivTol));
|
||||
SkScalar log = SkScalarLog(
|
||||
SkScalarDiv(dsqd,
|
||||
SkScalarMul(gSubdivTol, gSubdivTol)));
|
||||
static const SkScalar conv = SkScalarInvert(SkScalarLog(2));
|
||||
log = SkScalarMul(log, conv);
|
||||
return GrMin(GrMax(0, SkScalarCeilToInt(log)),kMaxSub);
|
||||
|
|
|
@ -460,6 +460,7 @@ public:
|
|||
AutoRenderTargetRestore() : fDrawState(NULL), fSavedTarget(NULL) {}
|
||||
AutoRenderTargetRestore(GrDrawState* ds, GrRenderTarget* newTarget) {
|
||||
fDrawState = NULL;
|
||||
fSavedTarget = NULL;
|
||||
this->set(ds, newTarget);
|
||||
}
|
||||
~AutoRenderTargetRestore() { this->set(NULL, NULL); }
|
||||
|
|
|
@ -43,8 +43,12 @@ static inline GrDrawState::Edge computeEdge(const GrPoint& p,
|
|||
|
||||
static inline GrPoint sanitizePoint(const GrPoint& pt) {
|
||||
GrPoint r;
|
||||
r.fX = SkScalarPin(pt.fX, -kMaxVertexValue, kMaxVertexValue);
|
||||
r.fY = SkScalarPin(pt.fY, -kMaxVertexValue, kMaxVertexValue);
|
||||
r.fX = SkScalarPin(pt.fX,
|
||||
SkFloatToScalar(-kMaxVertexValue),
|
||||
SkFloatToScalar(kMaxVertexValue));
|
||||
r.fY = SkScalarPin(pt.fY,
|
||||
SkFloatToScalar(-kMaxVertexValue),
|
||||
SkFloatToScalar(kMaxVertexValue));
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче