From f56ebc1167a793612f34175b5e33db5cef631457 Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Wed, 20 Oct 2010 11:19:43 -0400 Subject: Cleanup DoubleBufferedTexture and SharedTexture classes. The cleanup consisted of... 1. removing uneeded mutex calls 2. ensuring user's of the class fully initialize them before use 3. hiding protected variables to prevent potential misuse by subclasses There will be a follow on CL focusing on cleaning up the use of mutexes in BackedDoubleBufferedTexture. Change-Id: Ia642d54d8a5b154ac287640a07d8b2c0e5d85334 --- WebCore/platform/graphics/android/TilesManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'WebCore/platform/graphics/android/TilesManager.cpp') diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp index b05c640..bac5eb1 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -31,6 +31,7 @@ #include "BaseTile.h" #include "SkCanvas.h" #include "SkPaint.h" +#include #ifdef DEBUG @@ -67,7 +68,10 @@ TilesManager::TilesManager() for (int i = 0; i < DEFAULT_TEXTURES_ALLOCATION; i++) { BackedDoubleBufferedTexture* texture = new BackedDoubleBufferedTexture( tileWidth(), tileHeight()); - m_textures.append(texture); + // the atomic load ensures that the texture has been fully initialized + // before we pass a pointer for other threads to operate on + m_textures.append( + (BackedDoubleBufferedTexture*)android_atomic_acquire_load((int32_t*)&texture)); } m_pixmapsGenerationThread = new TexturesGenerator(); -- cgit v1.1