| 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 "CCResourceProvider.h" | 7 #include "CCResourceProvider.h" |
| 8 #ifdef LOG |
| 9 #undef LOG |
| 10 #endif |
| 8 | 11 |
| 12 #include "base/string_split.h" |
| 13 #include "base/string_util.h" |
| 9 #include "CCProxy.h" | 14 #include "CCProxy.h" |
| 10 #include "CCRendererGL.h" // For the GLC() macro. | 15 #include "CCRendererGL.h" // For the GLC() macro. |
| 11 #include "Extensions3DChromium.h" | 16 #include "Extensions3DChromium.h" |
| 12 #include "IntRect.h" | 17 #include "IntRect.h" |
| 13 #include "LayerTextureSubImage.h" | 18 #include "LayerTextureSubImage.h" |
| 14 #include <limits.h> | 19 #include <limits.h> |
| 15 #include <public/WebGraphicsContext3D.h> | 20 #include <public/WebGraphicsContext3D.h> |
| 16 #include <wtf/HashSet.h> | 21 #include <wtf/HashSet.h> |
| 17 | 22 |
| 18 using WebKit::WebGraphicsContext3D; | 23 using WebKit::WebGraphicsContext3D; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 WebGraphicsContext3D* context3d = m_context->context3D(); | 342 WebGraphicsContext3D* context3d = m_context->context3D(); |
| 338 if (!context3d) { | 343 if (!context3d) { |
| 339 m_maxTextureSize = INT_MAX; | 344 m_maxTextureSize = INT_MAX; |
| 340 | 345 |
| 341 // FIXME: Implement this path for software compositing. | 346 // FIXME: Implement this path for software compositing. |
| 342 return false; | 347 return false; |
| 343 } | 348 } |
| 344 if (!context3d->makeContextCurrent()) | 349 if (!context3d->makeContextCurrent()) |
| 345 return false; | 350 return false; |
| 346 | 351 |
| 347 WebKit::WebString extensionsWebString = context3d->getString(GraphicsContext
3D::EXTENSIONS); | 352 std::string extensionsString = UTF16ToASCII(context3d->getString(GraphicsCon
text3D::EXTENSIONS)); |
| 348 String extensionsString(extensionsWebString.data(), extensionsWebString.leng
th()); | 353 std::vector<std::string> extensions; |
| 349 Vector<String> extensions; | 354 base::SplitString(extensionsString, ' ', &extensions); |
| 350 extensionsString.split(' ', extensions); | |
| 351 bool useMapSub = false; | 355 bool useMapSub = false; |
| 352 for (size_t i = 0; i < extensions.size(); ++i) { | 356 for (size_t i = 0; i < extensions.size(); ++i) { |
| 353 if (extensions[i] == "GL_EXT_texture_storage") | 357 if (extensions[i] == "GL_EXT_texture_storage") |
| 354 m_useTextureStorageExt = true; | 358 m_useTextureStorageExt = true; |
| 355 else if (extensions[i] == "GL_ANGLE_texture_usage") | 359 else if (extensions[i] == "GL_ANGLE_texture_usage") |
| 356 m_useTextureUsageHint = true; | 360 m_useTextureUsageHint = true; |
| 357 else if (extensions[i] == "GL_CHROMIUM_map_sub") | 361 else if (extensions[i] == "GL_CHROMIUM_map_sub") |
| 358 useMapSub = true; | 362 useMapSub = true; |
| 359 else if (extensions[i] == "GL_CHROMIUM_shallow_flush") | 363 else if (extensions[i] == "GL_CHROMIUM_shallow_flush") |
| 360 m_useShallowFlush = true; | 364 m_useShallowFlush = true; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.e
nd(); ++it) { | 539 for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.e
nd(); ++it) { |
| 536 if (childPoolSet.contains(it->second.pool)) | 540 if (childPoolSet.contains(it->second.pool)) |
| 537 ++maxMailboxCount; | 541 ++maxMailboxCount; |
| 538 } | 542 } |
| 539 } | 543 } |
| 540 while (m_mailboxes.size() > maxMailboxCount) | 544 while (m_mailboxes.size() > maxMailboxCount) |
| 541 m_mailboxes.removeFirst(); | 545 m_mailboxes.removeFirst(); |
| 542 } | 546 } |
| 543 | 547 |
| 544 } | 548 } |
| OLD | NEW |