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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 593 |
594 ResourceProvider::ResourceType ResourceProvider::GetResourceType( | 594 ResourceProvider::ResourceType ResourceProvider::GetResourceType( |
595 ResourceId id) { | 595 ResourceId id) { |
596 return GetResource(id)->type; | 596 return GetResource(id)->type; |
597 } | 597 } |
598 | 598 |
599 void ResourceProvider::SetPixels(ResourceId id, | 599 void ResourceProvider::SetPixels(ResourceId id, |
600 const uint8_t* image, | 600 const uint8_t* image, |
601 const gfx::Rect& image_rect, | 601 const gfx::Rect& image_rect, |
602 const gfx::Rect& source_rect, | 602 const gfx::Rect& source_rect, |
603 gfx::Vector2d dest_offset) { | 603 const gfx::Vector2d& dest_offset) { |
604 Resource* resource = GetResource(id); | 604 Resource* resource = GetResource(id); |
605 DCHECK(!resource->locked_for_write); | 605 DCHECK(!resource->locked_for_write); |
606 DCHECK(!resource->lock_for_read_count); | 606 DCHECK(!resource->lock_for_read_count); |
607 DCHECK(resource->origin == Resource::Internal); | 607 DCHECK(resource->origin == Resource::Internal); |
608 DCHECK_EQ(resource->exported_count, 0); | 608 DCHECK_EQ(resource->exported_count, 0); |
609 DCHECK(ReadLockFenceHasPassed(resource)); | 609 DCHECK(ReadLockFenceHasPassed(resource)); |
610 LazyAllocate(resource); | 610 LazyAllocate(resource); |
611 | 611 |
612 if (resource->gl_id) { | 612 if (resource->gl_id) { |
613 DCHECK(!resource->pending_set_pixels); | 613 DCHECK(!resource->pending_set_pixels); |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); | 1851 gl->GetIntegerv(GL_ACTIVE_TEXTURE, &active_unit); |
1852 return active_unit; | 1852 return active_unit; |
1853 } | 1853 } |
1854 | 1854 |
1855 GLES2Interface* ResourceProvider::ContextGL() const { | 1855 GLES2Interface* ResourceProvider::ContextGL() const { |
1856 ContextProvider* context_provider = output_surface_->context_provider(); | 1856 ContextProvider* context_provider = output_surface_->context_provider(); |
1857 return context_provider ? context_provider->ContextGL() : NULL; | 1857 return context_provider ? context_provider->ContextGL() : NULL; |
1858 } | 1858 } |
1859 | 1859 |
1860 } // namespace cc | 1860 } // namespace cc |
OLD | NEW |