| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 | 1934 |
| 1935 void ResourceProvider::BindImageForSampling(Resource* resource) { | 1935 void ResourceProvider::BindImageForSampling(Resource* resource) { |
| 1936 GLES2Interface* gl = ContextGL(); | 1936 GLES2Interface* gl = ContextGL(); |
| 1937 DCHECK(resource->gl_id); | 1937 DCHECK(resource->gl_id); |
| 1938 DCHECK(resource->image_id); | 1938 DCHECK(resource->image_id); |
| 1939 | 1939 |
| 1940 // Release image currently bound to texture. | 1940 // Release image currently bound to texture. |
| 1941 gl->BindTexture(resource->target, resource->gl_id); | 1941 gl->BindTexture(resource->target, resource->gl_id); |
| 1942 if (resource->bound_image_id) | 1942 if (resource->bound_image_id) |
| 1943 gl->ReleaseTexImage2DCHROMIUM(resource->target, resource->bound_image_id); | 1943 gl->ReleaseTexImage2DCHROMIUM(resource->target, resource->bound_image_id); |
| 1944 gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id); | 1944 gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id, 0); |
| 1945 resource->bound_image_id = resource->image_id; | 1945 resource->bound_image_id = resource->image_id; |
| 1946 resource->dirty_image = false; | 1946 resource->dirty_image = false; |
| 1947 resource->SetLocallyUsed(); | 1947 resource->SetLocallyUsed(); |
| 1948 } | 1948 } |
| 1949 | 1949 |
| 1950 void ResourceProvider::WaitSyncTokenIfNeeded(ResourceId id) { | 1950 void ResourceProvider::WaitSyncTokenIfNeeded(ResourceId id) { |
| 1951 Resource* resource = GetResource(id); | 1951 Resource* resource = GetResource(id); |
| 1952 DCHECK_EQ(resource->exported_count, 0); | 1952 DCHECK_EQ(resource->exported_count, 0); |
| 1953 DCHECK(resource->allocated); | 1953 DCHECK(resource->allocated); |
| 1954 if (Resource::NEEDS_WAIT == resource->synchronization_state()) { | 1954 if (Resource::NEEDS_WAIT == resource->synchronization_state()) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2059 | 2059 |
| 2060 const int kImportance = 2; | 2060 const int kImportance = 2; |
| 2061 pmd->CreateSharedGlobalAllocatorDump(guid); | 2061 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 2062 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 2062 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 2063 } | 2063 } |
| 2064 | 2064 |
| 2065 return true; | 2065 return true; |
| 2066 } | 2066 } |
| 2067 | 2067 |
| 2068 } // namespace cc | 2068 } // namespace cc |
| OLD | NEW |