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 "cc/resource_provider.h" | 5 #include "cc/resource_provider.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 m_skCanvas.reset(new SkCanvas(m_skBitmap)); | 537 m_skCanvas.reset(new SkCanvas(m_skBitmap)); |
538 } | 538 } |
539 | 539 |
540 ResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() | 540 ResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() |
541 { | 541 { |
542 m_resourceProvider->unlockForWrite(m_resourceId); | 542 m_resourceProvider->unlockForWrite(m_resourceId); |
543 } | 543 } |
544 | 544 |
545 ResourceProvider::ResourceProvider(OutputSurface* context) | 545 ResourceProvider::ResourceProvider(OutputSurface* context) |
546 : m_outputSurface(context) | 546 : m_outputSurface(context) |
| 547 , m_offscreenContext3d(NULL) |
547 , m_nextId(1) | 548 , m_nextId(1) |
548 , m_nextChild(1) | 549 , m_nextChild(1) |
549 , m_defaultResourceType(GLTexture) | 550 , m_defaultResourceType(GLTexture) |
550 , m_useTextureStorageExt(false) | 551 , m_useTextureStorageExt(false) |
551 , m_useTextureUsageHint(false) | 552 , m_useTextureUsageHint(false) |
552 , m_useShallowFlush(false) | 553 , m_useShallowFlush(false) |
553 , m_maxTextureSize(0) | 554 , m_maxTextureSize(0) |
554 , m_bestTextureFormat(0) | 555 , m_bestTextureFormat(0) |
555 { | 556 { |
556 } | 557 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId)); | 1047 GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, resource->glId)); |
1047 if (m_useTextureStorageExt && isTextureFormatSupportedForStorage(format)) { | 1048 if (m_useTextureStorageExt && isTextureFormatSupportedForStorage(format)) { |
1048 GLenum storageFormat = textureToStorageFormat(format); | 1049 GLenum storageFormat = textureToStorageFormat(format); |
1049 GLC(context3d, context3d->texStorage2DEXT(GL_TEXTURE_2D, 1, storageForma
t, size.width(), size.height())); | 1050 GLC(context3d, context3d->texStorage2DEXT(GL_TEXTURE_2D, 1, storageForma
t, size.width(), size.height())); |
1050 } else | 1051 } else |
1051 GLC(context3d, context3d->texImage2D(GL_TEXTURE_2D, 0, format, size.widt
h(), size.height(), 0, format, GL_UNSIGNED_BYTE, 0)); | 1052 GLC(context3d, context3d->texImage2D(GL_TEXTURE_2D, 0, format, size.widt
h(), size.height(), 0, format, GL_UNSIGNED_BYTE, 0)); |
1052 } | 1053 } |
1053 | 1054 |
1054 | 1055 |
1055 } // namespace cc | 1056 } // namespace cc |
OLD | NEW |