/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/
/* This uses the magic number approach suggested here: * http://stereopsis.com/sree/fpu2006.html and used in * _cairo_fixed_from_double. It does banker's rounding * (i.e. round to nearest even)
*/ inline SkFDot6 SkScalarRoundToFDot6(SkScalar x, int shift = 0)
{ union { double fDouble;
int32_t fBits[2];
} tmp; int fractionalBits = 6 + shift; double magic = (1LL << (52 - (fractionalBits))) * 1.5;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.