Skip to content

Commit

Permalink
Update CCBlurLayer.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 8, 2024
1 parent cac1290 commit dc58f80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Utils/CCBlurLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ CCBlurLayer* CCBlurLayer::create()

void CCBlurLayer::visit()
{
auto start = std::chrono::high_resolution_clock::now();

if (this->getOpacity())
{
float v = this->getOpacity() / 255.0f;
Expand All @@ -86,6 +88,12 @@ void CCBlurLayer::visit()
}

CCLayerColor::visit();

auto end = std::chrono::high_resolution_clock::now();

std::chrono::duration<double, std::milli> duration = end - start;

log::info("visit took {}ms", duration.count());
}

void CCBlurLayer::draw()
Expand All @@ -95,6 +103,8 @@ void CCBlurLayer::draw()
if (blurStrength == 0)
return CCLayerColor::draw();

auto startwhole = std::chrono::high_resolution_clock::now();

auto start1 = std::chrono::high_resolution_clock::now();

GLint drawFbo = 0;
Expand Down Expand Up @@ -184,6 +194,12 @@ void CCBlurLayer::draw()
log::info("scene end took {}ms", duration2.count());

#endif

auto endwhole = std::chrono::high_resolution_clock::now();

std::chrono::duration<double, std::milli> durationwhole = endwhole - startwhole;

log::info("whole render took {}ms", durationwhole.count());
}

Result<std::string> Shader::compile(const std::filesystem::path& vertexPath, const std::filesystem::path& fragmentPath) {
Expand Down

0 comments on commit dc58f80

Please sign in to comment.