| 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
|
|
|