| 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/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" | 
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1472 | 1472 | 
| 1473 void ResourceProvider::CreateForTesting(ResourceId id) { | 1473 void ResourceProvider::CreateForTesting(ResourceId id) { | 
| 1474   LazyCreate(GetResource(id)); | 1474   LazyCreate(GetResource(id)); | 
| 1475 } | 1475 } | 
| 1476 | 1476 | 
| 1477 GLint ResourceProvider::WrapModeForTesting(ResourceId id) { | 1477 GLint ResourceProvider::WrapModeForTesting(ResourceId id) { | 
| 1478   Resource* resource = GetResource(id); | 1478   Resource* resource = GetResource(id); | 
| 1479   return resource->wrap_mode; | 1479   return resource->wrap_mode; | 
| 1480 } | 1480 } | 
| 1481 | 1481 | 
|  | 1482 GLenum ResourceProvider::TargetForTesting(ResourceId id) { | 
|  | 1483   Resource* resource = GetResource(id); | 
|  | 1484   return resource->target; | 
|  | 1485 } | 
|  | 1486 | 
| 1482 void ResourceProvider::LazyCreate(Resource* resource) { | 1487 void ResourceProvider::LazyCreate(Resource* resource) { | 
| 1483   if (resource->type != GLTexture || resource->gl_id != 0) | 1488   if (resource->type != GLTexture || resource->gl_id != 0) | 
| 1484     return; | 1489     return; | 
| 1485 | 1490 | 
| 1486   // Early out for resources that don't require texture creation. | 1491   // Early out for resources that don't require texture creation. | 
| 1487   if (resource->texture_pool == 0) | 1492   if (resource->texture_pool == 0) | 
| 1488     return; | 1493     return; | 
| 1489 | 1494 | 
| 1490   WebGraphicsContext3D* context3d = Context3d(); | 1495   WebGraphicsContext3D* context3d = Context3d(); | 
| 1491   DCHECK(context3d); | 1496   DCHECK(context3d); | 
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1697   } | 1702   } | 
| 1698   NOTREACHED(); | 1703   NOTREACHED(); | 
| 1699   return GL_RGBA; | 1704   return GL_RGBA; | 
| 1700 } | 1705 } | 
| 1701 | 1706 | 
| 1702 GLenum ResourceProvider::GetGLInternalFormat(ResourceFormat format) { | 1707 GLenum ResourceProvider::GetGLInternalFormat(ResourceFormat format) { | 
| 1703   return GetGLDataFormat(format); | 1708   return GetGLDataFormat(format); | 
| 1704 } | 1709 } | 
| 1705 | 1710 | 
| 1706 }  // namespace cc | 1711 }  // namespace cc | 
| OLD | NEW | 
|---|