当前位置: 首页>>代码示例>>C++>>正文


C++ Sk64::set方法代码示例

本文整理汇总了C++中Sk64::set方法的典型用法代码示例。如果您正苦于以下问题:C++ Sk64::set方法的具体用法?C++ Sk64::set怎么用?C++ Sk64::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sk64的用法示例。


在下文中一共展示了Sk64::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMSecs

SkMSec SkTime::GetMSecs()
{
    UnsignedWide    wide;
    Sk64            s;

    ::Microseconds(&wide);
    s.set(wide.hi, wide.lo);
    s.div(1000, Sk64::kRound_DivOption);
    return s.get32();
}
开发者ID:bluebellzhy,项目名称:chromium,代码行数:10,代码来源:SkTime.cpp

示例2: isLengthNearlyZero

// Calculates the square of the Euclidian distance to (dx,dy) and stores it in
// *lengthSquared.  Returns true if the distance is judged to be "nearly zero".
//
// This logic is encapsulated in a helper method to make it explicit that we
// always perform this check in the same manner, to avoid inconsistencies
// (see http://code.google.com/p/skia/issues/detail?id=560 ).
static inline bool isLengthNearlyZero(SkScalar dx, SkScalar dy,
                                      Sk64 *lengthSquared) {
    Sk64 tolSqr;
    getLengthSquared(dx, dy, lengthSquared);

    // we want nearlyzero^2, but to compute it fast we want to just do a
    // 32bit multiply, so we require that it not exceed 31bits. That is true
    // if nearlyzero is <= 0xB504, which should be trivial, since usually
    // nearlyzero is a very small fixed-point value.
    SkASSERT(SK_ScalarNearlyZero <= 0xB504);

    tolSqr.set(0, SK_ScalarNearlyZero * SK_ScalarNearlyZero);
    return *lengthSquared <= tolSqr;
}
开发者ID:jamorton,项目名称:blix,代码行数:20,代码来源:SkPoint.cpp


注:本文中的Sk64::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。