Пример #1
0
IRCode::IRCode(DexMethod* method): m_ir_list(new IRList()) {
  auto* dc = method->get_dex_code();
  generate_load_params(
      method, dc->get_registers_size() - dc->get_ins_size(), this);
  balloon(const_cast<DexMethod*>(method), m_ir_list);
  m_dbg = dc->release_debug_item();
}
void DelegateVideoControl::paint(QPainter *painter,
        const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    Q_UNUSED(option);
    Q_UNUSED(widget);

    painter->fillPath(shape(), brush());

    qreal frameWidth = rect().height() / 2;
    int position = frameWidth;

    if (mTotalTimeInMs > 0)
    {
        position = frameWidth + (rect().width() - (2 * frameWidth)) / mTotalTimeInMs * mCurrentTimeInMs;
    }

    int radius = rect().height() / 6;
    QRectF r(rect().x() + position - radius, rect().y() + (rect().height() / 4) - radius, radius * 2, radius * 2);

    painter->setBrush(UBSettings::documentViewLightColor);
    painter->drawEllipse(r);

    if(mDisplayCurrentTime)
    {
        painter->setBrush(UBSettings::paletteColor);
        painter->setPen(QPen(Qt::NoPen));
        QRectF balloon(rect().x() + position - frameWidth, rect().y() - (frameWidth * 1.2), 2 * frameWidth, frameWidth);
        painter->drawRoundedRect(balloon, frameWidth/2, frameWidth/2);

        QTime t;
        t = t.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs);
        QFont f = painter->font();
            f.setPointSizeF(f.pointSizeF() * mAntiScale);
        painter->setFont(f);
        painter->setPen(Qt::white);
        painter->drawText(balloon, Qt::AlignCenter, t.toString("m:ss"));
    }
}
Пример #3
0
MethodTransform* MethodTransform::get_method_transform(
    DexMethod* method,
    bool want_cfg /* = false */
) {
  {
    std::lock_guard<std::mutex> g(s_lock);
    auto it = s_cache.find(method);
    if (it != s_cache.end()) {
      MethodTransform* mt = it->second;
      return mt;
    }
  }
  FatMethod* fm = balloon(method);
  MethodTransform* mt = new MethodTransform(method, fm);
  if (want_cfg) {
    mt->build_cfg();
  }
  {
    std::lock_guard<std::mutex> g(s_lock);
    s_cache[method] = mt;
    return mt;
  }
}