OLD | NEW |
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 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "ThrottledTextureUploader.h" | 7 #include "ThrottledTextureUploader.h" |
8 | 8 |
9 #include "Extensions3DChromium.h" | 9 #include "Extensions3DChromium.h" |
10 #include <public/WebGraphicsContext3D.h> | 10 #include <public/WebGraphicsContext3D.h> |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 // Number of pending texture update queries to allow. | 14 // Number of pending texture update queries to allow. |
15 static const size_t maxPendingQueries = 2; | 15 static const size_t maxPendingQueries = 2; |
16 | 16 |
17 } // anonymous namespace | 17 } // anonymous namespace |
18 | 18 |
19 namespace WebCore { | 19 namespace cc { |
20 | 20 |
21 ThrottledTextureUploader::Query::Query(WebKit::WebGraphicsContext3D* context) | 21 ThrottledTextureUploader::Query::Query(WebKit::WebGraphicsContext3D* context) |
22 : m_context(context) | 22 : m_context(context) |
23 , m_queryId(0) | 23 , m_queryId(0) |
24 { | 24 { |
25 m_queryId = m_context->createQueryEXT(); | 25 m_queryId = m_context->createQueryEXT(); |
26 } | 26 } |
27 | 27 |
28 ThrottledTextureUploader::Query::~Query() | 28 ThrottledTextureUploader::Query::~Query() |
29 { | 29 { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 { | 109 { |
110 while (!m_pendingQueries.isEmpty()) { | 110 while (!m_pendingQueries.isEmpty()) { |
111 if (m_pendingQueries.first()->isPending()) | 111 if (m_pendingQueries.first()->isPending()) |
112 break; | 112 break; |
113 | 113 |
114 m_availableQueries.append(m_pendingQueries.takeFirst()); | 114 m_availableQueries.append(m_pendingQueries.takeFirst()); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } | 118 } |
OLD | NEW |