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

Side by Side Diff: cc/throttled_texture_uploader.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/thread_task.h ('k') | cc/throttled_texture_uploader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4
5 #ifndef ThrottledTextureUploader_h
6 #define ThrottledTextureUploader_h
7
8 #include "TextureUploader.h"
9
10 #include "base/basictypes.h"
11 #include <deque>
12 #include <wtf/Deque.h>
13
14 namespace WebKit {
15 class WebGraphicsContext3D;
16 }
17
18 namespace cc {
19
20 class ThrottledTextureUploader : public TextureUploader {
21 public:
22 static PassOwnPtr<ThrottledTextureUploader> create(WebKit::WebGraphicsContex t3D* context)
23 {
24 return adoptPtr(new ThrottledTextureUploader(context));
25 }
26 virtual ~ThrottledTextureUploader();
27
28 virtual size_t numBlockingUploads() OVERRIDE;
29 virtual void markPendingUploadsAsNonBlocking() OVERRIDE;
30 virtual double estimatedTexturesPerSecond() OVERRIDE;
31 virtual void uploadTexture(CCResourceProvider*, Parameters) OVERRIDE;
32
33 private:
34 class Query {
35 public:
36 static PassOwnPtr<Query> create(WebKit::WebGraphicsContext3D* context) { return adoptPtr(new Query(context)); }
37
38 virtual ~Query();
39
40 void begin();
41 void end();
42 bool isPending();
43 void wait();
44 unsigned value();
45 size_t texturesUploaded();
46 void markAsNonBlocking();
47 bool isNonBlocking();
48
49 private:
50 explicit Query(WebKit::WebGraphicsContext3D*);
51
52 WebKit::WebGraphicsContext3D* m_context;
53 unsigned m_queryId;
54 unsigned m_value;
55 bool m_hasValue;
56 bool m_isNonBlocking;
57 };
58
59 ThrottledTextureUploader(WebKit::WebGraphicsContext3D*);
60
61 void beginQuery();
62 void endQuery();
63 void processQueries();
64
65 WebKit::WebGraphicsContext3D* m_context;
66 Deque<OwnPtr<Query> > m_pendingQueries;
67 Deque<OwnPtr<Query> > m_availableQueries;
68 std::deque<double> m_texturesPerSecondHistory;
69 size_t m_numBlockingTextureUploads;
70
71 DISALLOW_COPY_AND_ASSIGN(ThrottledTextureUploader);
72 };
73
74 }
75
76 #endif
OLDNEW
« no previous file with comments | « cc/thread_task.h ('k') | cc/throttled_texture_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698