-//
-// 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) 2014 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.
+ *
+ */
#include <iostream>
#include <stdlib.h>
-#include <dali/dali.h>
+#include <dali/public-api/dali-core.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
material.SetNormalMapFileName("normal-map.png");
DALI_TEST_EQUALS( material.GetNormalMapFileName(), "normal-map.png", TEST_LOCATION);
- Image diffuseTexture = Image::New("diffuse-texture.png");
+ Image diffuseTexture = ResourceImage::New("diffuse-texture.png");
material.SetDiffuseTexture(diffuseTexture);
DALI_TEST_EQUALS( material.GetDiffuseTexture(), diffuseTexture, TEST_LOCATION );
- Image opacityTexture = Image::New("opacity-texture.png");
+ Image opacityTexture = ResourceImage::New("opacity-texture.png");
material.SetOpacityTexture(opacityTexture);
DALI_TEST_EQUALS( material.GetOpacityTexture(), opacityTexture, TEST_LOCATION);
- Image normalMap = Image::New("normal-map.png");
+ Image normalMap = ResourceImage::New("normal-map.png");
material.SetNormalMap(normalMap);
DALI_TEST_EQUALS( material.GetNormalMap(), normalMap, TEST_LOCATION);
{
Material material = Material::New("material");
- Image image = Image::New( "image.png", Image::Immediate, Image::Never );
+ Image image = ResourceImage::New( "image.png", ResourceImage::IMMEDIATE, Image::NEVER );
DALI_TEST_CHECK(image);
application.SendNotification();
application.Render(16);
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
+ Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
{
MeshActor meshActor = MeshActor::New(mesh);
meshActor.SetSize(100, 100);
- meshActor.SetAffectedByLighting(false);
Stage::GetCurrent().Add(meshActor);
application.SendNotification();
application.Render();
{
Material material = Material::New("material");
- Image image = Image::New( "image.png", Image::OnDemand, Image::Unused );
+ Image image = ResourceImage::New( "image.png", ResourceImage::ON_DEMAND, Image::UNUSED );
DALI_TEST_CHECK(image);
application.SendNotification();
application.Render(16);
{
MeshActor meshActor = MeshActor::New(mesh);
meshActor.SetSize(100, 100);
- meshActor.SetAffectedByLighting(false);
Stage::GetCurrent().Add(meshActor);
application.SendNotification();
application.Render();
Integration::ResourceRequest* request = application.GetPlatform().GetRequest();
DALI_TEST_CHECK( request != NULL );
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, true );
+ Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
if(request)