Index: cc/scoped_texture.h |
diff --git a/cc/scoped_texture.h b/cc/scoped_texture.h |
index 638cbb270ce9b24689d5095baf174ade4f4d1a13..a5b615c6e7c08a60ff6a5e46468fb4de970d9c2f 100644 |
--- a/cc/scoped_texture.h |
+++ b/cc/scoped_texture.h |
@@ -1,3 +1,46 @@ |
// Copyright 2012 The Chromium 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 CCScopedTexture_h |
+#define CCScopedTexture_h |
+ |
+#include "base/basictypes.h" |
+#include "CCTexture.h" |
+ |
+#if !ASSERT_DISABLED |
+#include "base/threading/platform_thread.h" |
+#endif |
+ |
+namespace cc { |
+ |
+class CCScopedTexture : protected CCTexture { |
+public: |
+ static PassOwnPtr<CCScopedTexture> create(CCResourceProvider* resourceProvider) { return adoptPtr(new CCScopedTexture(resourceProvider)); } |
+ virtual ~CCScopedTexture(); |
+ |
+ using CCTexture::id; |
+ using CCTexture::size; |
+ using CCTexture::format; |
+ using CCTexture::bytes; |
+ |
+ bool allocate(int pool, const IntSize&, GC3Denum format, CCResourceProvider::TextureUsageHint); |
+ void free(); |
+ void leak(); |
+ |
+protected: |
+ explicit CCScopedTexture(CCResourceProvider*); |
+ |
+private: |
+ CCResourceProvider* m_resourceProvider; |
+ |
+#if !ASSERT_DISABLED |
+ base::PlatformThreadId m_allocateThreadIdentifier; |
+#endif |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CCScopedTexture); |
+}; |
+ |
+} |
+ |
+#endif |