mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-25 23:40:51 +08:00
Merge branch 'yse:develop' into rename_version_functions
This commit is contained in:
commit
88f24f4763
6
.github/FUNDING.yml
vendored
6
.github/FUNDING.yml
vendored
@ -1,5 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: yse
|
||||
github: [yse, cas4ey]
|
||||
open_collective: easy_profiler
|
||||
custom: paypal.me/ysergey
|
||||
custom: ["https://paypal.me/ysergey"]
|
||||
|
10
.gitignore
vendored
10
.gitignore
vendored
@ -6,3 +6,13 @@ bin
|
||||
/*.prof
|
||||
.idea/
|
||||
bazel*
|
||||
|
||||
# CMake/QtCreator folders and files created on Windows
|
||||
CMakeFiles/
|
||||
*/CMakeFiles/
|
||||
CMakeCache*.*
|
||||
Makefile*
|
||||
moc_*.*
|
||||
mocs_*.*
|
||||
qrc_*.*
|
||||
*.cmake
|
||||
|
38
.travis.yml
38
.travis.yml
@ -1,8 +1,7 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
language: cpp
|
||||
dist: xenial
|
||||
cache: ccache
|
||||
matrix:
|
||||
language: cpp
|
||||
jobs:
|
||||
include:
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
@ -14,47 +13,26 @@ matrix:
|
||||
- g++-5
|
||||
- cmake
|
||||
- cmake-data
|
||||
- qt5-default
|
||||
env:
|
||||
-CXX_COMPILER=g++-5
|
||||
-C_COMPILER=gcc-5
|
||||
- os: osx
|
||||
osx_image: xcode10
|
||||
#compiler: clang
|
||||
osx_image: xcode11.4
|
||||
env:
|
||||
#-CXX_COMPILER=clang++
|
||||
#-C_COMPILER=clang
|
||||
-CXX_COMPILER=g++-5
|
||||
-C_COMPILER=gcc-5
|
||||
-HOMEBREW_NO_AUTO_UPDATE=1
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake --version
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
source /opt/qt55/bin/qt55-env.sh;
|
||||
qmake -v;
|
||||
else
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
export PATH=/usr/local/opt/qt/bin:$PATH;
|
||||
fi
|
||||
- cmake -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DCMAKE_C_COMPILER=$C_COMPILER .. && make -j3
|
||||
after_success:
|
||||
- cd ../sample && $CXX_COMPILER -std=c++11 -O3 main_clock.cpp -o test_clock && ./test_clock
|
||||
- ./build_express_test.sh
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
sudo add-apt-repository --yes ppa:beineri/opt-qt551-trusty;
|
||||
sudo apt-get update -qq;
|
||||
else
|
||||
brew update;
|
||||
fi
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
sudo apt-get -y install qt55tools qt55script qt55base qt55svg;
|
||||
else
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
brew install gcc5;
|
||||
brew install qt;
|
||||
brew link --force qt;
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2019 Sergey Yagovtsev, Victor Zarubkin
|
||||
Copyright (c) 2016-2021 Sergey Yagovtsev, Victor Zarubkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,6 +1,6 @@
|
||||
# easy_profiler [![2.1.0](https://img.shields.io/badge/stable-2.1.0-009688.svg)](https://github.com/yse/easy_profiler/releases/tag/v2.1.0) [![2.x.x](https://img.shields.io/badge/latest-2.x.x-f57f17.svg)](https://github.com/yse/easy_profiler)
|
||||
|
||||
[![Build Status](https://travis-ci.org/yse/easy_profiler.svg?branch=develop)](https://travis-ci.org/yse/easy_profiler)
|
||||
[![Build Status](https://travis-ci.com/yse/easy_profiler.svg?branch=develop)](https://travis-ci.com/yse/easy_profiler)
|
||||
[![Build Status](https://ci.appveyor.com/api/projects/status/github/yse/easy_profiler?branch=develop&svg=true)](https://ci.appveyor.com/project/yse/easy-profiler/branch/develop)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
@ -321,7 +321,7 @@ struct EasyFileHeader {
|
||||
# License
|
||||
|
||||
Licensed under either of
|
||||
- MIT license ([LICENSE.MIT](LICENSE.MIT) or http://opensource.org/licenses/MIT)
|
||||
- Apache License, Version 2.0, ([LICENSE.APACHE](LICENSE.APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
- MIT license ([mit.lic](mit.lic) or http://opensource.org/licenses/MIT)
|
||||
- Apache License, Version 2.0 ([apache.lic](apache.lic) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
at your option.
|
||||
|
@ -1271,9 +1271,26 @@ const ::profiler_gui::EasyBlock* GraphicsBlockItem::intersect(const QPointF& _po
|
||||
while (i <= levelIndex)
|
||||
{
|
||||
const auto& level = m_levels[i];
|
||||
size_t levelSize = level.size();
|
||||
|
||||
auto firstItemIterator = level.begin();
|
||||
auto lastItemIterator = level.begin();
|
||||
|
||||
// Ensure that firstItem and lastItem are within the permissible range
|
||||
if (firstItem < levelSize) {
|
||||
std::advance(firstItemIterator, firstItem);
|
||||
} else {
|
||||
firstItemIterator = level.end();
|
||||
}
|
||||
|
||||
if (lastItem <= levelSize) {
|
||||
std::advance(lastItemIterator, lastItem);
|
||||
} else {
|
||||
lastItemIterator = level.end();
|
||||
}
|
||||
|
||||
// Search for first visible item
|
||||
auto first = ::std::lower_bound(level.begin() + firstItem, level.begin() + lastItem, _pos.x(), [](const ::profiler_gui::EasyBlockItem& _item, qreal _value)
|
||||
auto first = ::std::lower_bound(firstItemIterator, lastItemIterator, _pos.x(), [](const ::profiler_gui::EasyBlockItem& _item, qreal _value)
|
||||
{
|
||||
return _item.left() < _value;
|
||||
});
|
||||
|
@ -374,9 +374,9 @@ const profiler::BlocksTree& TreeWidgetItem::block() const
|
||||
profiler::thread_id_t TreeWidgetItem::threadId() const
|
||||
{
|
||||
const QTreeWidgetItem* parentItem = this;
|
||||
while (parentItem->parent() != nullptr)
|
||||
while (parentItem != nullptr && parentItem->parent() != nullptr)
|
||||
{
|
||||
parentItem = parent();
|
||||
parentItem = parentItem->parent();
|
||||
}
|
||||
return static_cast<profiler::thread_id_t>(parentItem->data(COL_NAME, Qt::UserRole).toULongLong());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user