From c864d4df08dc9ac9d63e57afc7b80d7f41dfba79 Mon Sep 17 00:00:00 2001 From: Andrew Cox Date: Fri, 5 Dec 2014 13:31:43 +0000 Subject: [PATCH] Create 1 shared 1x1 white BitmapImage instead of 1 per item --- examples/item-view/item-view-example.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 9697cc7..b006c5f 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -349,6 +349,9 @@ public: // Set the title and icon to the current layout SetLayoutTitle(); SetLayoutImage(); + + // Store one 1x1 white image for multiple items to share for backgrounds: + mWhiteImage = BitmapImage::WHITE(); } Actor OnKeyboardPreFocusChange( Actor current, Actor proposed, Control::KeyboardFocusNavigationDirection direction ) @@ -905,7 +908,7 @@ public: // From ItemFactory // Add a checkbox child actor; invisible until edit-mode is enabled - ImageActor checkbox = ImageActor::New( BitmapImage::WHITE() ); + ImageActor checkbox = ImageActor::New( mWhiteImage ); checkbox.SetName( "CheckBox" ); checkbox.SetColor( Vector4(0.0f,0.0f,0.0f,0.6f) ); checkbox.SetParentOrigin( ParentOrigin::TOP_RIGHT ); @@ -1131,6 +1134,7 @@ private: unsigned int mAlphaFuncIndex; TextView mAlphaFunctionText; + BitmapImage mWhiteImage; }; void RunTest(Application& app) -- libgit2 0.21.4