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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 format); | 392 format); |
393 case RESOURCE_TYPE_BITMAP: | 393 case RESOURCE_TYPE_BITMAP: |
394 DCHECK_EQ(RGBA_8888, format); | 394 DCHECK_EQ(RGBA_8888, format); |
395 return CreateBitmap(size); | 395 return CreateBitmap(size); |
396 } | 396 } |
397 | 397 |
398 LOG(FATAL) << "Invalid default resource type."; | 398 LOG(FATAL) << "Invalid default resource type."; |
399 return 0; | 399 return 0; |
400 } | 400 } |
401 | 401 |
402 ResourceId ResourceProvider::CreateResourceWithTextureTarget( | 402 ResourceId ResourceProvider::CreateResourceWithImageTextureTarget( |
403 const gfx::Size& size, | 403 const gfx::Size& size, |
404 GLenum target, | |
405 TextureHint hint, | 404 TextureHint hint, |
406 ResourceFormat format) { | 405 ResourceFormat format) { |
407 DCHECK(!size.IsEmpty()); | 406 DCHECK(!size.IsEmpty()); |
407 GLenum target = GetImageTextureTarget(format); | |
reveman
2015/10/29 19:41:58
Can we move this into the RESOURCE_TYPE_GL_TEXTURE
ccameron
2015/10/29 20:01:29
You're right.
| |
408 if (!target) | |
reveman
2015/10/29 19:41:57
is this still needed?
ccameron
2015/10/29 20:01:29
Nope -- removed.
| |
409 target = GL_TEXTURE_2D; | |
408 switch (default_resource_type_) { | 410 switch (default_resource_type_) { |
409 case RESOURCE_TYPE_GL_TEXTURE: | 411 case RESOURCE_TYPE_GL_TEXTURE: |
410 return CreateGLTexture(size, | 412 return CreateGLTexture(size, |
411 target, | 413 target, |
412 hint, | 414 hint, |
413 format); | 415 format); |
414 case RESOURCE_TYPE_BITMAP: | 416 case RESOURCE_TYPE_BITMAP: |
415 DCHECK_EQ(RGBA_8888, format); | 417 DCHECK_EQ(RGBA_8888, format); |
416 return CreateBitmap(size); | 418 return CreateBitmap(size); |
417 } | 419 } |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1640 const int kImportance = 2; | 1642 const int kImportance = 2; |
1641 pmd->CreateSharedGlobalAllocatorDump(guid); | 1643 pmd->CreateSharedGlobalAllocatorDump(guid); |
1642 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1644 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
1643 } | 1645 } |
1644 } | 1646 } |
1645 | 1647 |
1646 return true; | 1648 return true; |
1647 } | 1649 } |
1648 | 1650 |
1649 } // namespace cc | 1651 } // namespace cc |
OLD | NEW |