-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// CLASS HEADER
#include <dali/internal/render/common/render-instruction.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/constants.h> // for Color::BLACK
#include <dali/internal/render/common/render-tracker.h>
+#include <dali/integration-api/debug.h>
namespace Dali
{
{
RenderInstruction::RenderInstruction()
-: mViewMatrix( 0 ),
- mProjectionMatrix( 0 ),
- mRenderTracker( NULL ),
+: mRenderTracker( NULL ),
mClearColor(),
mIsViewportSet( false ),
mIsClearColorSet( false ),
- mOffscreenTextureId( 0 ),
+ mFrameBuffer( 0 ),
+ mCamera( 0 ),
mNextFreeRenderList( 0 )
{
// reserve 6 lists, which is enough for three layers with opaque and transparent things on
const RenderList* RenderInstruction::GetRenderList( RenderListContainer::SizeType index ) const
{
- DALI_ASSERT_ALWAYS( (index < mNextFreeRenderList ) && "Renderlist index out of scope" );
+ DALI_ASSERT_DEBUG( (index < mNextFreeRenderList ) && (index < mRenderLists.Size()) && "Renderlist index out of container bounds" );
+
+ // Return null if the caller has passed an invalid index:
+ if( index >= std::min( mNextFreeRenderList, mRenderLists.Size() ) )
+ {
+ return 0;
+ }
+
return mRenderLists[ index ];
}
-void RenderInstruction::Reset( const Matrix* viewMatrix,
- const Matrix* projectionMatrix,
- unsigned int offscreenTextureId,
+void RenderInstruction::Reset( Camera* camera,
+ Render::FrameBuffer* frameBuffer,
const Viewport* viewport,
const Vector4* clearColor )
{
- mViewMatrix = viewMatrix;
- mProjectionMatrix = projectionMatrix;
+ mCamera = camera;
mViewport = viewport ? *viewport : Viewport();
mIsViewportSet = NULL != viewport;
mClearColor = clearColor ? *clearColor : Color::BLACK;
mIsClearColorSet = NULL != clearColor;
- mOffscreenTextureId = offscreenTextureId;
mRenderTracker = NULL;
mNextFreeRenderList = 0;
+ mFrameBuffer = frameBuffer;
RenderListContainer::Iterator iter = mRenderLists.Begin();
RenderListContainer::ConstIterator end = mRenderLists.End();