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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 } | 1599 } |
1600 | 1600 |
1601 void ResourceProvider::TransferResource(GLES2Interface* gl, | 1601 void ResourceProvider::TransferResource(GLES2Interface* gl, |
1602 ResourceId id, | 1602 ResourceId id, |
1603 TransferableResource* resource) { | 1603 TransferableResource* resource) { |
1604 Resource* source = GetResource(id); | 1604 Resource* source = GetResource(id); |
1605 DCHECK(!source->locked_for_write); | 1605 DCHECK(!source->locked_for_write); |
1606 DCHECK(!source->lock_for_read_count); | 1606 DCHECK(!source->lock_for_read_count); |
1607 DCHECK(source->origin != Resource::External || source->mailbox.IsValid()); | 1607 DCHECK(source->origin != Resource::External || source->mailbox.IsValid()); |
1608 DCHECK(source->allocated); | 1608 DCHECK(source->allocated); |
1609 DCHECK_EQ(source->wrap_mode, GL_CLAMP_TO_EDGE); | |
1610 resource->id = id; | 1609 resource->id = id; |
1611 resource->format = source->format; | 1610 resource->format = source->format; |
1612 resource->mailbox_holder.texture_target = source->target; | 1611 resource->mailbox_holder.texture_target = source->target; |
1613 resource->filter = source->filter; | 1612 resource->filter = source->filter; |
1614 resource->size = source->size; | 1613 resource->size = source->size; |
1615 | 1614 |
1616 if (source->type == Bitmap) { | 1615 if (source->type == Bitmap) { |
1617 resource->mailbox_holder.mailbox = source->shared_bitmap_id; | 1616 resource->mailbox_holder.mailbox = source->shared_bitmap_id; |
1618 resource->is_software = true; | 1617 resource->is_software = true; |
1619 } else if (!source->mailbox.IsValid()) { | 1618 } else if (!source->mailbox.IsValid()) { |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2270 ContextProvider* context_provider = output_surface_->context_provider(); | 2269 ContextProvider* context_provider = output_surface_->context_provider(); |
2271 return context_provider ? context_provider->ContextGL() : NULL; | 2270 return context_provider ? context_provider->ContextGL() : NULL; |
2272 } | 2271 } |
2273 | 2272 |
2274 class GrContext* ResourceProvider::GrContext() const { | 2273 class GrContext* ResourceProvider::GrContext() const { |
2275 ContextProvider* context_provider = output_surface_->context_provider(); | 2274 ContextProvider* context_provider = output_surface_->context_provider(); |
2276 return context_provider ? context_provider->GrContext() : NULL; | 2275 return context_provider ? context_provider->GrContext() : NULL; |
2277 } | 2276 } |
2278 | 2277 |
2279 } // namespace cc | 2278 } // namespace cc |
OLD | NEW |