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 | 8 #ifdef LOG |
9 #undef LOG | 9 #undef LOG |
10 #endif | 10 #endif |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 , m_useShallowFlush(false) | 334 , m_useShallowFlush(false) |
335 , m_maxTextureSize(0) | 335 , m_maxTextureSize(0) |
336 { | 336 { |
337 } | 337 } |
338 | 338 |
339 bool CCResourceProvider::initialize() | 339 bool CCResourceProvider::initialize() |
340 { | 340 { |
341 ASSERT(CCProxy::isImplThread()); | 341 ASSERT(CCProxy::isImplThread()); |
342 WebGraphicsContext3D* context3d = m_context->context3D(); | 342 WebGraphicsContext3D* context3d = m_context->context3D(); |
343 if (!context3d) { | 343 if (!context3d) { |
344 m_maxTextureSize = INT_MAX; | 344 m_maxTextureSize = INT_MAX; |
danakj
2012/09/19 18:35:14
If you do something like
if (textureSize > m_maxT
aelias_OOO_until_Jul13
2012/09/19 19:58:27
(textureSize > m_maxTextureSize) would always be f
danakj
2012/09/19 20:06:18
er.. false. yes. I'd prefer a magic number, yeh. M
| |
345 | 345 return true; |
346 // FIXME: Implement this path for software compositing. | |
347 return false; | |
348 } | 346 } |
349 if (!context3d->makeContextCurrent()) | 347 if (!context3d->makeContextCurrent()) |
350 return false; | 348 return false; |
351 | 349 |
352 std::string extensionsString = UTF16ToASCII(context3d->getString(GraphicsCon text3D::EXTENSIONS)); | 350 std::string extensionsString = UTF16ToASCII(context3d->getString(GraphicsCon text3D::EXTENSIONS)); |
353 std::vector<std::string> extensions; | 351 std::vector<std::string> extensions; |
354 base::SplitString(extensionsString, ' ', &extensions); | 352 base::SplitString(extensionsString, ' ', &extensions); |
355 bool useMapSub = false; | 353 bool useMapSub = false; |
356 for (size_t i = 0; i < extensions.size(); ++i) { | 354 for (size_t i = 0; i < extensions.size(); ++i) { |
357 if (extensions[i] == "GL_EXT_texture_storage") | 355 if (extensions[i] == "GL_EXT_texture_storage") |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.e nd(); ++it) { | 537 for (ResourceMap::iterator it = m_resources.begin(); it != m_resources.e nd(); ++it) { |
540 if (childPoolSet.contains(it->second.pool)) | 538 if (childPoolSet.contains(it->second.pool)) |
541 ++maxMailboxCount; | 539 ++maxMailboxCount; |
542 } | 540 } |
543 } | 541 } |
544 while (m_mailboxes.size() > maxMailboxCount) | 542 while (m_mailboxes.size() > maxMailboxCount) |
545 m_mailboxes.removeFirst(); | 543 m_mailboxes.removeFirst(); |
546 } | 544 } |
547 | 545 |
548 } | 546 } |
OLD | NEW |