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

Unified Diff: cc/texture_update_controller.h

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « cc/texture_layer_impl.cc ('k') | cc/texture_update_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_update_controller.h
diff --git a/cc/texture_update_controller.h b/cc/texture_update_controller.h
index 638cbb270ce9b24689d5095baf174ade4f4d1a13..74bb8ca957403e0c2107e8eeaa733815e170de96 100644
--- a/cc/texture_update_controller.h
+++ b/cc/texture_update_controller.h
@@ -1,3 +1,77 @@
// 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 CCTextureUpdateController_h
+#define CCTextureUpdateController_h
+
+#include "base/basictypes.h"
+#include "base/time.h"
+#include "CCTextureUpdateQueue.h"
+#include "CCTimer.h"
+#include <wtf/OwnPtr.h>
+
+namespace cc {
+
+class TextureUploader;
+
+class CCTextureUpdateControllerClient {
+public:
+ virtual void readyToFinalizeTextureUpdates() = 0;
+
+protected:
+ virtual ~CCTextureUpdateControllerClient() { }
+};
+
+class CCTextureUpdateController : public CCTimerClient {
+public:
+ static PassOwnPtr<CCTextureUpdateController> create(CCTextureUpdateControllerClient* client, CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureUploader* uploader)
+ {
+ return adoptPtr(new CCTextureUpdateController(client, thread, queue, resourceProvider, uploader));
+ }
+ static size_t maxPartialTextureUpdates();
+
+ virtual ~CCTextureUpdateController();
+
+ // Discard uploads to textures that were evicted on the impl thread.
+ void discardUploadsToEvictedResources();
+
+ void performMoreUpdates(base::TimeTicks timeLimit);
+ void finalize();
+
+ // CCTimerClient implementation.
+ virtual void onTimerFired() OVERRIDE;
+
+ // Virtual for testing.
+ virtual base::TimeTicks now() const;
+ virtual base::TimeDelta updateMoreTexturesTime() const;
+ virtual size_t updateMoreTexturesSize() const;
+
+protected:
+ CCTextureUpdateController(CCTextureUpdateControllerClient*, CCThread*, PassOwnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureUploader*);
+
+ static size_t maxFullUpdatesPerTick(TextureUploader*);
+
+ size_t maxBlockingUpdates() const;
+
+ // This returns true when there were textures left to update.
+ bool updateMoreTexturesIfEnoughTimeRemaining();
+ void updateMoreTexturesNow();
+
+ CCTextureUpdateControllerClient* m_client;
+ OwnPtr<CCTimer> m_timer;
+ OwnPtr<CCTextureUpdateQueue> m_queue;
+ bool m_contentsTexturesPurged;
+ CCResourceProvider* m_resourceProvider;
+ TextureUploader* m_uploader;
+ base::TimeTicks m_timeLimit;
+ size_t m_textureUpdatesPerTick;
+ bool m_firstUpdateAttempt;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(CCTextureUpdateController);
+};
+
+}
+
+#endif // CCTextureUpdateController_h
« no previous file with comments | « cc/texture_layer_impl.cc ('k') | cc/texture_update_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698