X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Fdali-test-suite-utils%2Ftest-graphics-controller.cpp;h=319ec6751d87d0ae4434d1710e57b559bd8e3bd9;hb=c0331129f93aa7504464fd95ae916a8389af33af;hp=d2d8b161b9a14bafb49ee24ed5bd6b667bd26824;hpb=ac573667ce89ead8a885d1e6b81be432d577e41d;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp index d2d8b16..319ec67 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,8 @@ #include #include +#include + namespace Dali { std::ostream& operator<<(std::ostream& o, const Graphics::BufferCreateInfo& bufferCreateInfo) @@ -78,7 +80,7 @@ std::ostream& operator<<(std::ostream& o, const Graphics::TextureCreateInfo& cre << " usageFlags:" << std::hex << createInfo.usageFlags << " data:" << std::hex << createInfo.data << " dataSize:" << std::dec << createInfo.dataSize - << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr; + << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr.Get(); return o; } @@ -584,15 +586,15 @@ public: }; TestGraphicsController::TestGraphicsController() -: mCallStack(true, "TestGraphicsController."), - mCommandBufferCallStack(true, "TestCommandBuffer."), - mFrameBufferCallStack(true, "TestFrameBuffer.") +: mCallStack(false, "TestGraphicsController."), + mCommandBufferCallStack(false, "TestCommandBuffer."), + mFrameBufferCallStack(false, "TestFrameBuffer.") { mCallStack.Enable(true); mCommandBufferCallStack.Enable(true); auto& trace = mGl.GetTextureTrace(); trace.Enable(true); - trace.EnableLogging(true); + trace.EnableLogging(false); } void TestGraphicsController::SubmitCommandBuffers(const Graphics::SubmitInfo& submitInfo) @@ -693,6 +695,19 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com BindPipeline(currentPipeline); break; } + case CommandType::DRAW_NATIVE: + { + auto info = &cmd.data.draw.drawNative.drawNativeInfo; + + if(info->glesNativeInfo.eglSharedContextStoragePointer) + { + auto* anyContext = reinterpret_cast(info->glesNativeInfo.eglSharedContextStoragePointer); + *anyContext = reinterpret_cast(0x12345678u); + } + + CallbackBase::ExecuteReturn(*info->callback, info->userData); + break; + } case CommandType::DRAW: { if(currentPipeline) @@ -1028,9 +1043,11 @@ void TestGraphicsController::BindPipeline(TestGraphicsPipeline* pipeline) */ void TestGraphicsController::PresentRenderTarget(Graphics::RenderTarget* renderTarget) { + auto* rt = static_cast(renderTarget); TraceCallStack::NamedParams namedParams; namedParams["renderTarget"] << std::hex << renderTarget; - mCallStack.PushCall("PresentRenderTarget", "", namedParams); + namedParams["surface"] << std::hex << rt->mCreateInfo.surface; + mCallStack.PushCall("PresentRenderTarget", namedParams.str(), namedParams); } /** @@ -1197,7 +1214,7 @@ Graphics::UniquePtr TestGraphicsController::CreateProgram(con source.resize(graphicsShader->mCreateInfo.sourceSize); memcpy(&source[0], graphicsShader->mCreateInfo.sourceData, graphicsShader->mCreateInfo.sourceSize); - if(!std::equal(source.begin(), source.end(), cacheEntry.shaders[shader.pipelineStage].begin())) + if(!std::equal(source.begin(), source.end(), cacheEntry.shaders[shader.pipelineStage].begin(), cacheEntry.shaders[shader.pipelineStage].end())) { found = false; break; @@ -1237,7 +1254,10 @@ Graphics::UniquePtr TestGraphicsController::CreateSampler(con Graphics::UniquePtr TestGraphicsController::CreateRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo, Graphics::UniquePtr&& oldRenderTarget) { - mCallStack.PushCall("CreateRenderTarget", ""); + TraceCallStack::NamedParams namedParams; + namedParams["surface"] << std::hex << renderTargetCreateInfo.surface; + mCallStack.PushCall("CreateRenderTarget", namedParams.str(), namedParams); + return Graphics::MakeUnique(mGl, renderTargetCreateInfo); } @@ -1282,7 +1302,7 @@ Graphics::MemoryRequirements TestGraphicsController::GetBufferMemoryRequirements return Graphics::MemoryRequirements{}; } -const Graphics::TextureProperties& TestGraphicsController::GetTextureProperties(const Graphics::Texture& texture) +Graphics::TextureProperties TestGraphicsController::GetTextureProperties(const Graphics::Texture& texture) { static Graphics::TextureProperties textureProperties{}; mCallStack.PushCall("GetTextureProperties", "");