Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3506)

Unified Diff: experimental/flocking_geese/nacl_app/locking_image_data.h

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/flocking_geese/nacl_app/goose.cc ('k') | experimental/flocking_geese/nacl_app/png_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/flocking_geese/nacl_app/locking_image_data.h
diff --git a/experimental/flocking_geese/nacl_app/locking_image_data.h b/experimental/flocking_geese/nacl_app/locking_image_data.h
deleted file mode 100644
index 1a282ccc558bab0ce48c9beccb2bb9e5a7328e8c..0000000000000000000000000000000000000000
--- a/experimental/flocking_geese/nacl_app/locking_image_data.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef LOCKING_IMAGE_DATA_H_
-#define LOCKING_IMAGE_DATA_H_
-
-#include "ppapi/cpp/image_data.h"
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/size.h"
-#include "threading/pthread_ext.h"
-
-namespace flocking_geese {
-
-// An extension of ImageData that can protect direct pixel access thorugh a
-// mutex lock.
-class LockingImageData : public pp::ImageData {
- public:
- LockingImageData(pp::Instance* instance,
- PP_ImageDataFormat format,
- const pp::Size& size,
- bool init_to_zero)
- : ImageData(instance, format, size, init_to_zero) {
- pthread_mutex_init(&pixel_buffer_mutex_, NULL);
- }
-
- virtual ~LockingImageData() {
- UnlockPixels();
- pthread_mutex_destroy(&pixel_buffer_mutex_);
- }
-
- // Acquire the lock in |pixel_owner_| that governs the pixel buffer. Return
- // a pointer to the locked pixel buffer if successful; return NULL otherwise.
- uint32_t* LockPixels() {
- uint32_t* pixels = NULL;
- if (pthread_mutex_lock(&pixel_buffer_mutex_) == PTHREAD_MUTEX_SUCCESS) {
- pixels = PixelBufferNoLock();
- }
- return pixels;
- }
-
- // Release the lock governing the pixel bugger in |pixel_owner_|.
- void UnlockPixels() {
- pthread_mutex_unlock(&pixel_buffer_mutex_);
- }
-
- uint32_t* PixelBufferNoLock() {
- return is_null() ? NULL : static_cast<uint32_t*>(data());
- }
-
- private:
- mutable pthread_mutex_t pixel_buffer_mutex_;
-};
-} // namespace flocking_geese
-
-#endif // LOCKING_IMAGE_DATA_H_
-
« no previous file with comments | « experimental/flocking_geese/nacl_app/goose.cc ('k') | experimental/flocking_geese/nacl_app/png_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698