| 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 #include "ThrottledTextureUploader.h" | 6 #include "ThrottledTextureUploader.h" |
| 7 | 7 |
| 8 #include "Extensions3DChromium.h" | 8 #include "Extensions3DChromium.h" |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <public/WebGraphicsContext3D.h> | 10 #include <public/WebGraphicsContext3D.h> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 m_queryId = m_context->createQueryEXT(); | 37 m_queryId = m_context->createQueryEXT(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 ThrottledTextureUploader::Query::~Query() | 40 ThrottledTextureUploader::Query::~Query() |
| 41 { | 41 { |
| 42 m_context->deleteQueryEXT(m_queryId); | 42 m_context->deleteQueryEXT(m_queryId); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void ThrottledTextureUploader::Query::begin() | 45 void ThrottledTextureUploader::Query::begin() |
| 46 { | 46 { |
| 47 m_hasValue = false; |
| 47 m_context->beginQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM, m_q
ueryId); | 48 m_context->beginQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM, m_q
ueryId); |
| 48 } | 49 } |
| 49 | 50 |
| 50 void ThrottledTextureUploader::Query::end(double texturesUploaded) | 51 void ThrottledTextureUploader::Query::end(double texturesUploaded) |
| 51 { | 52 { |
| 52 m_context->endQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM); | 53 m_context->endQueryEXT(Extensions3DChromium::COMMANDS_ISSUED_CHROMIUM); |
| 53 m_texturesUploaded = texturesUploaded; | 54 m_texturesUploaded = texturesUploaded; |
| 54 } | 55 } |
| 55 | 56 |
| 56 bool ThrottledTextureUploader::Query::isPending() | 57 bool ThrottledTextureUploader::Query::isPending() |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 167 |
| 167 // Remove the oldest values from our history and insert the new one | 168 // Remove the oldest values from our history and insert the new one |
| 168 m_texturesPerSecondHistory.pop_back(); | 169 m_texturesPerSecondHistory.pop_back(); |
| 169 m_texturesPerSecondHistory.push_front(texturesPerSecond); | 170 m_texturesPerSecondHistory.push_front(texturesPerSecond); |
| 170 | 171 |
| 171 m_availableQueries.append(m_pendingQueries.takeFirst()); | 172 m_availableQueries.append(m_pendingQueries.takeFirst()); |
| 172 } | 173 } |
| 173 } | 174 } |
| 174 | 175 |
| 175 } | 176 } |
| OLD | NEW |