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 "cc/resource_provider.h" | 7 #include "cc/resource_provider.h" |
8 | 8 |
9 #include <limits.h> | 9 #include <limits.h> |
10 | 10 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 | 323 |
324 double ResourceProvider::estimatedUploadsPerSecond() | 324 double ResourceProvider::estimatedUploadsPerSecond() |
325 { | 325 { |
326 if (!m_textureUploader) | 326 if (!m_textureUploader) |
327 return 0.0; | 327 return 0.0; |
328 | 328 |
329 return m_textureUploader->estimatedTexturesPerSecond(); | 329 return m_textureUploader->estimatedTexturesPerSecond(); |
330 } | 330 } |
331 | 331 |
| 332 void ResourceProvider::flushUploads() |
| 333 { |
| 334 if (!m_textureUploader) |
| 335 return; |
| 336 |
| 337 m_textureUploader->flush(); |
| 338 } |
| 339 |
332 void ResourceProvider::flush() | 340 void ResourceProvider::flush() |
333 { | 341 { |
334 DCHECK(Proxy::isImplThread()); | 342 DCHECK(Proxy::isImplThread()); |
335 WebGraphicsContext3D* context3d = m_context->context3D(); | 343 WebGraphicsContext3D* context3d = m_context->context3D(); |
336 if (context3d) | 344 if (context3d) |
337 context3d->flush(); | 345 context3d->flush(); |
338 } | 346 } |
339 | 347 |
340 bool ResourceProvider::shallowFlushIfSupported() | 348 bool ResourceProvider::shallowFlushIfSupported() |
341 { | 349 { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 else if (extensions[i] == "GL_CHROMIUM_map_sub") | 516 else if (extensions[i] == "GL_CHROMIUM_map_sub") |
509 useMapSub = true; | 517 useMapSub = true; |
510 else if (extensions[i] == "GL_CHROMIUM_shallow_flush") | 518 else if (extensions[i] == "GL_CHROMIUM_shallow_flush") |
511 m_useShallowFlush = true; | 519 m_useShallowFlush = true; |
512 else if (extensions[i] == "GL_CHROMIUM_bind_uniform_location") | 520 else if (extensions[i] == "GL_CHROMIUM_bind_uniform_location") |
513 useBindUniform = true; | 521 useBindUniform = true; |
514 } | 522 } |
515 | 523 |
516 m_textureCopier = AcceleratedTextureCopier::create(context3d, useBindUniform
); | 524 m_textureCopier = AcceleratedTextureCopier::create(context3d, useBindUniform
); |
517 | 525 |
518 m_textureUploader = TextureUploader::create(context3d, useMapSub); | 526 m_textureUploader = TextureUploader::create(context3d, useMapSub, m_useShall
owFlush); |
519 GLC(context3d, context3d->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize
)); | 527 GLC(context3d, context3d->getIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize
)); |
520 return true; | 528 return true; |
521 } | 529 } |
522 | 530 |
523 int ResourceProvider::createChild(int pool) | 531 int ResourceProvider::createChild(int pool) |
524 { | 532 { |
525 DCHECK(Proxy::isImplThread()); | 533 DCHECK(Proxy::isImplThread()); |
526 Child childInfo; | 534 Child childInfo; |
527 childInfo.pool = pool; | 535 childInfo.pool = pool; |
528 int child = m_nextChild++; | 536 int child = m_nextChild++; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 g_debugZone = zone; | 717 g_debugZone = zone; |
710 } | 718 } |
711 | 719 |
712 void ResourceProvider::debugNotifyLeaveZone() | 720 void ResourceProvider::debugNotifyLeaveZone() |
713 { | 721 { |
714 g_debugZone = 0; | 722 g_debugZone = 0; |
715 } | 723 } |
716 | 724 |
717 | 725 |
718 } | 726 } |
OLD | NEW |