X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-graphics-controller.cpp;h=08867195432360e2a431ff8c9e8ef6e26dcf6296;hp=a3a0feef74fb43501547271093e959e9495eacb4;hb=383021a5eeff5ade0a8e7d50d3fdbe5a7549f0da;hpb=2022199840909d30df3f6a2935bcfcf9da4c597f diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp index a3a0fee..0886719 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp @@ -24,6 +24,7 @@ #include "test-graphics-render-target.h" #include "test-graphics-sampler.h" #include "test-graphics-shader.h" +#include "test-graphics-sync-object.h" #include "test-graphics-texture.h" #include @@ -599,11 +600,14 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com } case CommandType::BIND_UNIFORM_BUFFER: { - auto& bindings = cmd.data.bindUniformBuffers; - auto buffer = bindings.standaloneUniformsBufferBinding; + if(currentPipeline) + { + auto& bindings = cmd.data.bindUniformBuffers; + auto buffer = bindings.standaloneUniformsBufferBinding; - // based on reflection, issue gl calls - buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program)); + // based on reflection, issue gl calls + buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program), bindings.standaloneUniformsBufferBinding); + } break; } case CommandType::BIND_SAMPLERS: @@ -618,25 +622,34 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com } case CommandType::DRAW: { - mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology), - 0, - cmd.data.draw.draw.vertexCount); + if(currentPipeline) + { + mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology), + 0, + cmd.data.draw.draw.vertexCount); + } break; } case CommandType::DRAW_INDEXED: { - mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), - static_cast(cmd.data.draw.drawIndexed.indexCount), - GL_UNSIGNED_SHORT, - reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + if(currentPipeline) + { + mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), + static_cast(cmd.data.draw.drawIndexed.indexCount), + GL_UNSIGNED_SHORT, + reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + } break; } case CommandType::DRAW_INDEXED_INDIRECT: { - mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), - static_cast(cmd.data.draw.drawIndexed.indexCount), - GL_UNSIGNED_SHORT, - reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + if(currentPipeline) + { + mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), + static_cast(cmd.data.draw.drawIndexed.indexCount), + GL_UNSIGNED_SHORT, + reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + } break; } case CommandType::SET_SCISSOR: @@ -837,6 +850,7 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com const auto& area = cmd.data.beginRenderPass.renderArea; if(area.x == 0 && area.y == 0 && + renderTarget && area.width == renderTarget->mCreateInfo.extent.width && area.height == renderTarget->mCreateInfo.extent.height) { @@ -861,6 +875,11 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com } case CommandType::END_RENDER_PASS: { + if(cmd.data.endRenderPass.syncObject != nullptr) + { + auto syncObject = Uncast(cmd.data.endRenderPass.syncObject); + syncObject->InitializeResource(); // create the sync object. + } break; } } @@ -996,6 +1015,15 @@ void TestGraphicsController::UpdateTextures(const std::vector(&texture); + mGl.BindTexture(gfxTexture->GetTarget(), 0); + mGl.GenerateMipmap(gfxTexture->GetTarget()); +} + bool TestGraphicsController::EnableDepthStencilBuffer(bool enableDepth, bool enableStencil) { TraceCallStack::NamedParams namedParams; @@ -1140,6 +1168,14 @@ Graphics::UniquePtr TestGraphicsController::CreateRender return Graphics::MakeUnique(mGl, renderTargetCreateInfo); } +Graphics::UniquePtr TestGraphicsController::CreateSyncObject( + const Graphics::SyncObjectCreateInfo& syncObjectCreateInfo, + Graphics::UniquePtr&& oldSyncObject) +{ + mCallStack.PushCall("CreateSyncObject", ""); + return Graphics::MakeUnique(mGraphicsSyncImpl, syncObjectCreateInfo); +} + Graphics::UniquePtr TestGraphicsController::MapBufferRange(const Graphics::MapBufferInfo& mapInfo) { mCallStack.PushCall("MapBufferRange", "");