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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 gfx::Rect rect(size); | 602 gfx::Rect rect(size); |
603 child_resource_provider_->SetPixels(id1, data1, rect, rect, gfx::Vector2d()); | 603 child_resource_provider_->SetPixels(id1, data1, rect, rect, gfx::Vector2d()); |
604 | 604 |
605 ResourceProvider::ResourceId id2 = child_resource_provider_->CreateResource( | 605 ResourceProvider::ResourceId id2 = child_resource_provider_->CreateResource( |
606 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 606 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
607 uint8_t data2[4] = { 5, 5, 5, 5 }; | 607 uint8_t data2[4] = { 5, 5, 5, 5 }; |
608 child_resource_provider_->SetPixels(id2, data2, rect, rect, gfx::Vector2d()); | 608 child_resource_provider_->SetPixels(id2, data2, rect, rect, gfx::Vector2d()); |
609 | 609 |
610 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( | 610 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( |
611 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 611 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
612 child_resource_provider_->MapImageRasterBuffer(id3); | 612 child_resource_provider_->AcquireImageRasterBuffer(id3); |
613 child_resource_provider_->UnmapImageRasterBuffer(id3); | 613 child_resource_provider_->ReleaseImageRasterBuffer(id3); |
614 | 614 |
615 GLuint external_texture_id = child_context_->createExternalTexture(); | 615 GLuint external_texture_id = child_context_->createExternalTexture(); |
616 child_context_->bindTexture(GL_TEXTURE_EXTERNAL_OES, external_texture_id); | 616 child_context_->bindTexture(GL_TEXTURE_EXTERNAL_OES, external_texture_id); |
617 | 617 |
618 gpu::Mailbox external_mailbox; | 618 gpu::Mailbox external_mailbox; |
619 child_context_->genMailboxCHROMIUM(external_mailbox.name); | 619 child_context_->genMailboxCHROMIUM(external_mailbox.name); |
620 child_context_->produceTextureCHROMIUM(GL_TEXTURE_EXTERNAL_OES, | 620 child_context_->produceTextureCHROMIUM(GL_TEXTURE_EXTERNAL_OES, |
621 external_mailbox.name); | 621 external_mailbox.name); |
622 const GLuint external_sync_point = child_context_->insertSyncPoint(); | 622 const GLuint external_sync_point = child_context_->insertSyncPoint(); |
623 ResourceProvider::ResourceId id4 = | 623 ResourceProvider::ResourceId id4 = |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 | 945 |
946 ResourceProvider::ResourceId id2 = child_resource_provider_->CreateResource( | 946 ResourceProvider::ResourceId id2 = child_resource_provider_->CreateResource( |
947 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 947 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
948 uint8_t data2[4] = { 5, 5, 5, 5 }; | 948 uint8_t data2[4] = { 5, 5, 5, 5 }; |
949 child_resource_provider_->SetPixels(id2, data2, rect, rect, gfx::Vector2d()); | 949 child_resource_provider_->SetPixels(id2, data2, rect, rect, gfx::Vector2d()); |
950 | 950 |
951 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( | 951 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( |
952 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 952 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
953 uint8_t data3[4] = { 6, 7, 8, 9 }; | 953 uint8_t data3[4] = { 6, 7, 8, 9 }; |
954 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); | 954 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); |
955 SkCanvas* raster_canvas = child_resource_provider_->MapImageRasterBuffer(id3); | 955 RasterBuffer* raster_buffer = |
956 raster_canvas->writePixels(info, data3, info.minRowBytes(), 0, 0); | 956 child_resource_provider_->AcquireImageRasterBuffer(id3); |
957 child_resource_provider_->UnmapImageRasterBuffer(id3); | 957 SkCanvas* canvas = raster_buffer->AcquireSkCanvas(); |
| 958 canvas->writePixels(info, data3, info.minRowBytes(), 0, 0); |
| 959 raster_buffer->ReleaseSkCanvas(); |
| 960 child_resource_provider_->ReleaseImageRasterBuffer(id3); |
958 | 961 |
959 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); | 962 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); |
960 shared_memory->CreateAndMapAnonymous(1); | 963 shared_memory->CreateAndMapAnonymous(1); |
961 base::SharedMemory* shared_memory_ptr = shared_memory.get(); | 964 base::SharedMemory* shared_memory_ptr = shared_memory.get(); |
962 ResourceProvider::ResourceId id4 = | 965 ResourceProvider::ResourceId id4 = |
963 child_resource_provider_->CreateResourceFromTextureMailbox( | 966 child_resource_provider_->CreateResourceFromTextureMailbox( |
964 TextureMailbox(shared_memory_ptr, gfx::Size(1, 1)), | 967 TextureMailbox(shared_memory_ptr, gfx::Size(1, 1)), |
965 SingleReleaseCallback::Create(base::Bind( | 968 SingleReleaseCallback::Create(base::Bind( |
966 &SharedMemoryReleaseCallback, base::Passed(&shared_memory)))); | 969 &SharedMemoryReleaseCallback, base::Passed(&shared_memory)))); |
967 | 970 |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2931 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); | 2934 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); |
2932 | 2935 |
2933 EXPECT_CALL(*context, NextTextureId()).WillRepeatedly(Return(texture_id)); | 2936 EXPECT_CALL(*context, NextTextureId()).WillRepeatedly(Return(texture_id)); |
2934 | 2937 |
2935 id = resource_provider->CreateResource( | 2938 id = resource_provider->CreateResource( |
2936 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 2939 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
2937 context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, | 2940 context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
2938 GL_INNOCENT_CONTEXT_RESET_ARB); | 2941 GL_INNOCENT_CONTEXT_RESET_ARB); |
2939 | 2942 |
2940 resource_provider->AcquirePixelRasterBuffer(id); | 2943 resource_provider->AcquirePixelRasterBuffer(id); |
2941 SkCanvas* raster_canvas = resource_provider->MapPixelRasterBuffer(id); | 2944 RasterBuffer* raster_buffer = resource_provider->MapPixelRasterBuffer(id); |
2942 EXPECT_TRUE(raster_canvas == NULL); | 2945 SkCanvas* canvas = raster_buffer->AcquireSkCanvas(); |
| 2946 EXPECT_TRUE(canvas == NULL); |
| 2947 raster_buffer->ReleaseSkCanvas(); |
2943 resource_provider->UnmapPixelRasterBuffer(id); | 2948 resource_provider->UnmapPixelRasterBuffer(id); |
2944 resource_provider->ReleasePixelRasterBuffer(id); | 2949 resource_provider->ReleasePixelRasterBuffer(id); |
2945 Mock::VerifyAndClearExpectations(context); | 2950 Mock::VerifyAndClearExpectations(context); |
2946 } | 2951 } |
2947 | 2952 |
2948 TEST_P(ResourceProviderTest, Image_GLTexture) { | 2953 TEST_P(ResourceProviderTest, Image_GLTexture) { |
2949 // Only for GL textures. | 2954 // Only for GL textures. |
2950 if (GetParam() != ResourceProvider::GLTexture) | 2955 if (GetParam() != ResourceProvider::GLTexture) |
2951 return; | 2956 return; |
2952 scoped_ptr<AllocationTrackingContext3D> context_owned( | 2957 scoped_ptr<AllocationTrackingContext3D> context_owned( |
(...skipping 27 matching lines...) Expand all Loading... |
2980 .WillOnce(Return(kImageId)) | 2985 .WillOnce(Return(kImageId)) |
2981 .RetiresOnSaturation(); | 2986 .RetiresOnSaturation(); |
2982 EXPECT_CALL(*context, getImageParameterivCHROMIUM(kImageId, | 2987 EXPECT_CALL(*context, getImageParameterivCHROMIUM(kImageId, |
2983 GL_IMAGE_ROWBYTES_CHROMIUM, | 2988 GL_IMAGE_ROWBYTES_CHROMIUM, |
2984 _)) | 2989 _)) |
2985 .WillOnce(SetArgPointee<2>(kStride)) | 2990 .WillOnce(SetArgPointee<2>(kStride)) |
2986 .RetiresOnSaturation(); | 2991 .RetiresOnSaturation(); |
2987 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) | 2992 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) |
2988 .WillOnce(Return(dummy_mapped_buffer_address)) | 2993 .WillOnce(Return(dummy_mapped_buffer_address)) |
2989 .RetiresOnSaturation(); | 2994 .RetiresOnSaturation(); |
2990 resource_provider->MapImageRasterBuffer(id); | 2995 resource_provider->AcquireImageRasterBuffer(id); |
2991 | 2996 |
2992 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) | 2997 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) |
2993 .Times(1) | 2998 .Times(1) |
2994 .RetiresOnSaturation(); | 2999 .RetiresOnSaturation(); |
2995 resource_provider->UnmapImageRasterBuffer(id); | 3000 resource_provider->ReleaseImageRasterBuffer(id); |
2996 | 3001 |
2997 EXPECT_CALL(*context, NextTextureId()) | 3002 EXPECT_CALL(*context, NextTextureId()) |
2998 .WillOnce(Return(kTextureId)) | 3003 .WillOnce(Return(kTextureId)) |
2999 .RetiresOnSaturation(); | 3004 .RetiresOnSaturation(); |
3000 // Once in CreateTextureId and once in BindForSampling | 3005 // Once in CreateTextureId and once in BindForSampling |
3001 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)).Times(2) | 3006 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)).Times(2) |
3002 .RetiresOnSaturation(); | 3007 .RetiresOnSaturation(); |
3003 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) | 3008 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) |
3004 .Times(1) | 3009 .Times(1) |
3005 .RetiresOnSaturation(); | 3010 .RetiresOnSaturation(); |
3006 { | 3011 { |
3007 ResourceProvider::ScopedSamplerGL lock_gl( | 3012 ResourceProvider::ScopedSamplerGL lock_gl( |
3008 resource_provider.get(), id, GL_TEXTURE_2D, GL_LINEAR); | 3013 resource_provider.get(), id, GL_TEXTURE_2D, GL_LINEAR); |
3009 EXPECT_EQ(kTextureId, lock_gl.texture_id()); | 3014 EXPECT_EQ(kTextureId, lock_gl.texture_id()); |
3010 } | 3015 } |
3011 | 3016 |
3012 EXPECT_CALL( | 3017 EXPECT_CALL( |
3013 *context, | 3018 *context, |
3014 getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _)) | 3019 getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _)) |
3015 .WillOnce(SetArgPointee<2>(kStride)) | 3020 .WillOnce(SetArgPointee<2>(kStride)) |
3016 .RetiresOnSaturation(); | 3021 .RetiresOnSaturation(); |
3017 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) | 3022 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) |
3018 .WillOnce(Return(dummy_mapped_buffer_address)) | 3023 .WillOnce(Return(dummy_mapped_buffer_address)) |
3019 .RetiresOnSaturation(); | 3024 .RetiresOnSaturation(); |
3020 resource_provider->MapImageRasterBuffer(id); | 3025 resource_provider->AcquireImageRasterBuffer(id); |
3021 | 3026 |
3022 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) | 3027 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) |
3023 .Times(1) | 3028 .Times(1) |
3024 .RetiresOnSaturation(); | 3029 .RetiresOnSaturation(); |
3025 resource_provider->UnmapImageRasterBuffer(id); | 3030 resource_provider->ReleaseImageRasterBuffer(id); |
3026 | 3031 |
3027 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)).Times(1) | 3032 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)).Times(1) |
3028 .RetiresOnSaturation(); | 3033 .RetiresOnSaturation(); |
3029 EXPECT_CALL(*context, releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) | 3034 EXPECT_CALL(*context, releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) |
3030 .Times(1) | 3035 .Times(1) |
3031 .RetiresOnSaturation(); | 3036 .RetiresOnSaturation(); |
3032 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) | 3037 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId)) |
3033 .Times(1) | 3038 .Times(1) |
3034 .RetiresOnSaturation(); | 3039 .RetiresOnSaturation(); |
3035 EXPECT_CALL(*context, RetireTextureId(kTextureId)) | 3040 EXPECT_CALL(*context, RetireTextureId(kTextureId)) |
(...skipping 26 matching lines...) Expand all Loading... |
3062 | 3067 |
3063 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( | 3068 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
3064 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); | 3069 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); |
3065 | 3070 |
3066 id = resource_provider->CreateResource( | 3071 id = resource_provider->CreateResource( |
3067 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 3072 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
3068 | 3073 |
3069 SkBitmap bitmap; | 3074 SkBitmap bitmap; |
3070 bitmap.allocN32Pixels(size.width(), size.height()); | 3075 bitmap.allocN32Pixels(size.width(), size.height()); |
3071 *(bitmap.getAddr32(0, 0)) = kBadBeef; | 3076 *(bitmap.getAddr32(0, 0)) = kBadBeef; |
3072 SkCanvas* canvas = resource_provider->MapImageRasterBuffer(id); | 3077 RasterBuffer* raster_buffer = resource_provider->AcquireImageRasterBuffer(id); |
| 3078 SkCanvas* canvas = raster_buffer->AcquireSkCanvas(); |
3073 ASSERT_TRUE(!!canvas); | 3079 ASSERT_TRUE(!!canvas); |
3074 canvas->writePixels(bitmap, 0, 0); | 3080 canvas->writePixels(bitmap, 0, 0); |
3075 resource_provider->UnmapImageRasterBuffer(id); | 3081 raster_buffer->ReleaseSkCanvas(); |
| 3082 resource_provider->ReleaseImageRasterBuffer(id); |
3076 | 3083 |
3077 { | 3084 { |
3078 ResourceProvider::ScopedReadLockSoftware lock(resource_provider.get(), id); | 3085 ResourceProvider::ScopedReadLockSoftware lock(resource_provider.get(), id); |
3079 const SkBitmap* sk_bitmap = lock.sk_bitmap(); | 3086 const SkBitmap* sk_bitmap = lock.sk_bitmap(); |
3080 EXPECT_EQ(sk_bitmap->width(), size.width()); | 3087 EXPECT_EQ(sk_bitmap->width(), size.width()); |
3081 EXPECT_EQ(sk_bitmap->height(), size.height()); | 3088 EXPECT_EQ(sk_bitmap->height(), size.height()); |
3082 EXPECT_EQ(*sk_bitmap->getAddr32(0, 0), kBadBeef); | 3089 EXPECT_EQ(*sk_bitmap->getAddr32(0, 0), kBadBeef); |
3083 } | 3090 } |
3084 | 3091 |
3085 resource_provider->DeleteResource(id); | 3092 resource_provider->DeleteResource(id); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3122 .WillOnce(Return(kImageId)) | 3129 .WillOnce(Return(kImageId)) |
3123 .RetiresOnSaturation(); | 3130 .RetiresOnSaturation(); |
3124 EXPECT_CALL( | 3131 EXPECT_CALL( |
3125 *context, | 3132 *context, |
3126 getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _)) | 3133 getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _)) |
3127 .WillOnce(SetArgPointee<2>(kStride)) | 3134 .WillOnce(SetArgPointee<2>(kStride)) |
3128 .RetiresOnSaturation(); | 3135 .RetiresOnSaturation(); |
3129 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) | 3136 EXPECT_CALL(*context, mapImageCHROMIUM(kImageId)) |
3130 .WillOnce(Return(dummy_mapped_buffer_address)) | 3137 .WillOnce(Return(dummy_mapped_buffer_address)) |
3131 .RetiresOnSaturation(); | 3138 .RetiresOnSaturation(); |
3132 resource_provider->MapImageRasterBuffer(source_id); | 3139 resource_provider->AcquireImageRasterBuffer(source_id); |
3133 Mock::VerifyAndClearExpectations(context); | 3140 Mock::VerifyAndClearExpectations(context); |
3134 | 3141 |
3135 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) | 3142 EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId)) |
3136 .Times(1) | 3143 .Times(1) |
3137 .RetiresOnSaturation(); | 3144 .RetiresOnSaturation(); |
3138 resource_provider->UnmapImageRasterBuffer(source_id); | 3145 resource_provider->ReleaseImageRasterBuffer(source_id); |
3139 Mock::VerifyAndClearExpectations(context); | 3146 Mock::VerifyAndClearExpectations(context); |
3140 | 3147 |
3141 dest_id = resource_provider->CreateResource( | 3148 dest_id = resource_provider->CreateResource( |
3142 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 3149 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
3143 | 3150 |
3144 EXPECT_CALL(*context, NextTextureId()) | 3151 EXPECT_CALL(*context, NextTextureId()) |
3145 .WillOnce(Return(kDestTextureId)) | 3152 .WillOnce(Return(kDestTextureId)) |
3146 .RetiresOnSaturation(); | 3153 .RetiresOnSaturation(); |
3147 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kDestTextureId)) | 3154 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kDestTextureId)) |
3148 .Times(1) | 3155 .Times(1) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3188 | 3195 |
3189 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( | 3196 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
3190 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); | 3197 output_surface.get(), shared_bitmap_manager_.get(), 0, false, 1, false)); |
3191 | 3198 |
3192 source_id = resource_provider->CreateResource( | 3199 source_id = resource_provider->CreateResource( |
3193 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 3200 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
3194 | 3201 |
3195 SkBitmap bitmap; | 3202 SkBitmap bitmap; |
3196 bitmap.allocN32Pixels(size.width(), size.height()); | 3203 bitmap.allocN32Pixels(size.width(), size.height()); |
3197 *(bitmap.getAddr32(0, 0)) = kBadBeef; | 3204 *(bitmap.getAddr32(0, 0)) = kBadBeef; |
3198 SkCanvas* canvas = resource_provider->MapImageRasterBuffer(source_id); | 3205 RasterBuffer* raster_buffer = |
| 3206 resource_provider->AcquireImageRasterBuffer(source_id); |
| 3207 SkCanvas* canvas = raster_buffer->AcquireSkCanvas(); |
3199 ASSERT_TRUE(!!canvas); | 3208 ASSERT_TRUE(!!canvas); |
3200 canvas->writePixels(bitmap, 0, 0); | 3209 canvas->writePixels(bitmap, 0, 0); |
3201 resource_provider->UnmapImageRasterBuffer(source_id); | 3210 raster_buffer->ReleaseSkCanvas(); |
| 3211 resource_provider->ReleaseImageRasterBuffer(source_id); |
3202 | 3212 |
3203 dest_id = resource_provider->CreateResource( | 3213 dest_id = resource_provider->CreateResource( |
3204 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); | 3214 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format); |
3205 | 3215 |
3206 resource_provider->CopyResource(source_id, dest_id); | 3216 resource_provider->CopyResource(source_id, dest_id); |
3207 | 3217 |
3208 { | 3218 { |
3209 ResourceProvider::ScopedReadLockSoftware lock(resource_provider.get(), | 3219 ResourceProvider::ScopedReadLockSoftware lock(resource_provider.get(), |
3210 dest_id); | 3220 dest_id); |
3211 const SkBitmap* sk_bitmap = lock.sk_bitmap(); | 3221 const SkBitmap* sk_bitmap = lock.sk_bitmap(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3405 resource_provider->AllocateForTesting(id); | 3415 resource_provider->AllocateForTesting(id); |
3406 Mock::VerifyAndClearExpectations(context); | 3416 Mock::VerifyAndClearExpectations(context); |
3407 | 3417 |
3408 DCHECK_EQ(10u, context->PeekTextureId()); | 3418 DCHECK_EQ(10u, context->PeekTextureId()); |
3409 resource_provider->DeleteResource(id); | 3419 resource_provider->DeleteResource(id); |
3410 } | 3420 } |
3411 } | 3421 } |
3412 | 3422 |
3413 } // namespace | 3423 } // namespace |
3414 } // namespace cc | 3424 } // namespace cc |
OLD | NEW |