Commit c674e501128288336a09888fb6510ca4a7a8797a
[dali_1.1.17] Merge branch 'devel/master'
Change-Id: I830f119bf1dd9368a47e9f4095cd36b3eaacd420
Showing
7 changed files
with
150 additions
and
7 deletions
build/tizen/CMakeLists.txt
| ... | ... | @@ -42,14 +42,16 @@ SET(DALI_EXAMPLE_BIN \\"${BINDIR}/\\") |
| 42 | 42 | SET(DALI_LOCALE_DIR \\"${LOCALE_DIR}\\") |
| 43 | 43 | SET(DALI_LANG \\"${LANG}\\") |
| 44 | 44 | |
| 45 | -FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") | |
| 46 | -FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") | |
| 47 | -FILE(GLOB LOCAL_IMAGES_GIF RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif") | |
| 48 | -FILE(GLOB LOCAL_IMAGES_BMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.bmp") | |
| 49 | -FILE(GLOB LOCAL_IMAGES_ICO RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ico") | |
| 45 | +FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") | |
| 46 | +FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") | |
| 47 | +FILE(GLOB LOCAL_IMAGES_GIF RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif") | |
| 48 | +FILE(GLOB LOCAL_IMAGES_BMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.bmp") | |
| 49 | +FILE(GLOB LOCAL_IMAGES_ICO RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ico") | |
| 50 | 50 | FILE(GLOB LOCAL_IMAGES_WBMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.wbmp") |
| 51 | +FILE(GLOB LOCAL_IMAGES_KTX RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ktx") | |
| 52 | +FILE(GLOB LOCAL_IMAGES_ASTC RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.astc") | |
| 51 | 53 | |
| 52 | -SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP}) | |
| 54 | +SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP};${LOCAL_IMAGES_KTX};${LOCAL_IMAGES_ASTC}) | |
| 53 | 55 | FOREACH(flag ${LOCAL_IMAGES_LIST}) |
| 54 | 56 | INSTALL(FILES ${LOCAL_IMAGES_DIR}/${flag} DESTINATION ${IMAGES_DIR}) |
| 55 | 57 | ENDFOREACH(flag) | ... | ... |
examples/compressed-texture-formats/compressed-texture-formats-example.cpp
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2016 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +#include <dali-toolkit/dali-toolkit.h> | |
| 19 | + | |
| 20 | +using namespace Dali; | |
| 21 | +using Dali::Toolkit::TextLabel; | |
| 22 | + | |
| 23 | +const char* IMAGE_FILENAME_ETC = DALI_IMAGE_DIR "tx-etc1.ktx"; | |
| 24 | +const char* IMAGE_FILENAME_ASTC_LINEAR = DALI_IMAGE_DIR "tx-astc-4x4-linear.ktx"; | |
| 25 | +const char* IMAGE_FILENAME_ASTC_LINEAR_NATIVE = DALI_IMAGE_DIR "tx-astc-4x4-linear-native.astc"; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * @brief This example shows 3 images, each of a different compressed texture type. | |
| 29 | + * If built and run on a OpenGL ES 3.1 compatable target, then all 3 images will display. | |
| 30 | + * Otherwise, the top image will display and the other 2 will appear as black squares. | |
| 31 | + */ | |
| 32 | +class CompressedTextureFormatsController : public ConnectionTracker | |
| 33 | +{ | |
| 34 | +public: | |
| 35 | + | |
| 36 | + CompressedTextureFormatsController( Application& application ) | |
| 37 | + : mApplication( application ) | |
| 38 | + { | |
| 39 | + // Connect to the Application's Init signal | |
| 40 | + mApplication.InitSignal().Connect( this, &CompressedTextureFormatsController::Create ); | |
| 41 | + } | |
| 42 | + | |
| 43 | + ~CompressedTextureFormatsController() | |
| 44 | + { | |
| 45 | + // Nothing to do here; | |
| 46 | + } | |
| 47 | + | |
| 48 | + // The Init signal is received once (only) during the Application lifetime | |
| 49 | + void Create( Application& application ) | |
| 50 | + { | |
| 51 | + // Get a handle to the stage | |
| 52 | + Stage stage = Stage::GetCurrent(); | |
| 53 | + stage.SetBackgroundColor( Color::WHITE ); | |
| 54 | + | |
| 55 | + // Setup a TableView to hold a grid of images and labels. | |
| 56 | + Toolkit::TableView table = Toolkit::TableView::New( 3u, 2u ); | |
| 57 | + table.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 58 | + table.SetParentOrigin( ParentOrigin::CENTER ); | |
| 59 | + table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 60 | + table.SetRelativeWidth( 0u, 0.5f ); | |
| 61 | + table.SetRelativeWidth( 1u, 0.5f ); | |
| 62 | + table.SetRelativeHeight( 0u, 1.0f / 3.0f ); | |
| 63 | + table.SetRelativeHeight( 1u, 1.0f / 3.0f ); | |
| 64 | + table.SetRelativeHeight( 2u, 1.0f / 3.0f ); | |
| 65 | + | |
| 66 | + | |
| 67 | + // Add text labels. | |
| 68 | + TextLabel textLabel = TextLabel::New( "ETC1 (KTX):" ); | |
| 69 | + textLabel.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 70 | + textLabel.SetParentOrigin( ParentOrigin::CENTER ); | |
| 71 | + textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 72 | + textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); | |
| 73 | + table.AddChild( textLabel, Toolkit::TableView::CellPosition( 0u, 0u ) ); | |
| 74 | + table.SetCellAlignment( Toolkit::TableView::CellPosition( 0u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); | |
| 75 | + | |
| 76 | + textLabel = TextLabel::New( "ASTC (KTX) 4x4 linear:" ); | |
| 77 | + textLabel.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 78 | + textLabel.SetParentOrigin( ParentOrigin::CENTER ); | |
| 79 | + textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 80 | + textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); | |
| 81 | + table.AddChild( textLabel, Toolkit::TableView::CellPosition( 1u, 0u ) ); | |
| 82 | + table.SetCellAlignment( Toolkit::TableView::CellPosition( 1u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); | |
| 83 | + | |
| 84 | + textLabel = TextLabel::New( "ASTC (Native) 4x4 linear:" ); | |
| 85 | + textLabel.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 86 | + textLabel.SetParentOrigin( ParentOrigin::CENTER ); | |
| 87 | + textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); | |
| 88 | + textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); | |
| 89 | + table.AddChild( textLabel, Toolkit::TableView::CellPosition( 2u, 0u ) ); | |
| 90 | + table.SetCellAlignment( Toolkit::TableView::CellPosition( 2u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER ); | |
| 91 | + | |
| 92 | + // Add images. | |
| 93 | + Toolkit::ImageView imageView = Toolkit::ImageView::New( ResourceImage::New( IMAGE_FILENAME_ETC ) ); | |
| 94 | + imageView.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 95 | + imageView.SetParentOrigin( ParentOrigin::CENTER ); | |
| 96 | + table.AddChild( imageView, Toolkit::TableView::CellPosition( 0u, 1u ) ); | |
| 97 | + | |
| 98 | + imageView = Toolkit::ImageView::New( ResourceImage::New( IMAGE_FILENAME_ASTC_LINEAR ) ); | |
| 99 | + imageView.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 100 | + imageView.SetParentOrigin( ParentOrigin::CENTER ); | |
| 101 | + table.AddChild( imageView, Toolkit::TableView::CellPosition( 1u, 1u ) ); | |
| 102 | + | |
| 103 | + imageView = Toolkit::ImageView::New( ResourceImage::New( IMAGE_FILENAME_ASTC_LINEAR_NATIVE ) ); | |
| 104 | + imageView.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 105 | + imageView.SetParentOrigin( ParentOrigin::CENTER ); | |
| 106 | + table.AddChild( imageView, Toolkit::TableView::CellPosition( 2u, 1u ) ); | |
| 107 | + | |
| 108 | + stage.Add( table ); | |
| 109 | + | |
| 110 | + // Respond to a click anywhere on the stage | |
| 111 | + stage.GetRootLayer().TouchedSignal().Connect( this, &CompressedTextureFormatsController::OnTouch ); | |
| 112 | + } | |
| 113 | + | |
| 114 | + bool OnTouch( Actor actor, const TouchEvent& touch ) | |
| 115 | + { | |
| 116 | + // quit the application | |
| 117 | + mApplication.Quit(); | |
| 118 | + return true; | |
| 119 | + } | |
| 120 | + | |
| 121 | +private: | |
| 122 | + Application& mApplication; | |
| 123 | +}; | |
| 124 | + | |
| 125 | +void RunTest( Application& application ) | |
| 126 | +{ | |
| 127 | + CompressedTextureFormatsController test( application ); | |
| 128 | + | |
| 129 | + application.MainLoop(); | |
| 130 | +} | |
| 131 | + | |
| 132 | +// Entry point for Linux & Tizen applications | |
| 133 | +// | |
| 134 | +int main( int argc, char **argv ) | |
| 135 | +{ | |
| 136 | + Application application = Application::New( &argc, &argv ); | |
| 137 | + | |
| 138 | + RunTest( application ); | |
| 139 | + | |
| 140 | + return 0; | |
| 141 | +} | ... | ... |
packaging/com.samsung.dali-demo.spec
resources/images/tx-astc-4x4-linear-native.astc
0 → 100644
No preview for this file type
resources/images/tx-astc-4x4-linear.ktx
0 → 100644
No preview for this file type
resources/images/tx-astc-4x4-srgb.ktx
0 → 100644
No preview for this file type
resources/images/tx-etc1.ktx
0 → 100644
No preview for this file type