| 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 resources_.erase(it); | 577 resources_.erase(it); |
| 578 } | 578 } |
| 579 | 579 |
| 580 ResourceProvider::ResourceType ResourceProvider::GetResourceType( | 580 ResourceProvider::ResourceType ResourceProvider::GetResourceType( |
| 581 ResourceId id) { | 581 ResourceId id) { |
| 582 return GetResource(id)->type; | 582 return GetResource(id)->type; |
| 583 } | 583 } |
| 584 | 584 |
| 585 void ResourceProvider::SetPixels(ResourceId id, | 585 void ResourceProvider::SetPixels(ResourceId id, |
| 586 const uint8_t* image, | 586 const uint8_t* image, |
| 587 gfx::Rect image_rect, | 587 const gfx::Rect& image_rect, |
| 588 gfx::Rect source_rect, | 588 const gfx::Rect& source_rect, |
| 589 gfx::Vector2d dest_offset) { | 589 gfx::Vector2d dest_offset) { |
| 590 Resource* resource = GetResource(id); | 590 Resource* resource = GetResource(id); |
| 591 DCHECK(!resource->locked_for_write); | 591 DCHECK(!resource->locked_for_write); |
| 592 DCHECK(!resource->lock_for_read_count); | 592 DCHECK(!resource->lock_for_read_count); |
| 593 DCHECK(!resource->external); | 593 DCHECK(!resource->external); |
| 594 DCHECK_EQ(resource->exported_count, 0); | 594 DCHECK_EQ(resource->exported_count, 0); |
| 595 DCHECK(ReadLockFenceHasPassed(resource)); | 595 DCHECK(ReadLockFenceHasPassed(resource)); |
| 596 LazyAllocate(resource); | 596 LazyAllocate(resource); |
| 597 | 597 |
| 598 if (resource->gl_id) { | 598 if (resource->gl_id) { |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); | 1804 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); |
| 1805 return active_unit; | 1805 return active_unit; |
| 1806 } | 1806 } |
| 1807 | 1807 |
| 1808 GLES2Interface* ResourceProvider::ContextGL() const { | 1808 GLES2Interface* ResourceProvider::ContextGL() const { |
| 1809 ContextProvider* context_provider = output_surface_->context_provider(); | 1809 ContextProvider* context_provider = output_surface_->context_provider(); |
| 1810 return context_provider ? context_provider->ContextGL() : NULL; | 1810 return context_provider ? context_provider->ContextGL() : NULL; |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 } // namespace cc | 1813 } // namespace cc |
| OLD | NEW |