Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: cc/resources/scoped_resource.cc

Issue 1422103003: cc: Remove the ability to specify a GL texture target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/scoped_resource.h ('k') | cc/test/fake_picture_layer_tiling_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/scoped_resource.h" 5 #include "cc/resources/scoped_resource.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 ScopedResource::ScopedResource(ResourceProvider* resource_provider) 9 ScopedResource::ScopedResource(ResourceProvider* resource_provider)
10 : resource_provider_(resource_provider) { 10 : resource_provider_(resource_provider) {
(...skipping 11 matching lines...) Expand all
22 DCHECK(!size.IsEmpty()); 22 DCHECK(!size.IsEmpty());
23 23
24 set_dimensions(size, format); 24 set_dimensions(size, format);
25 set_id(resource_provider_->CreateResource(size, hint, format)); 25 set_id(resource_provider_->CreateResource(size, hint, format));
26 26
27 #if DCHECK_IS_ON() 27 #if DCHECK_IS_ON()
28 allocate_thread_id_ = base::PlatformThread::CurrentId(); 28 allocate_thread_id_ = base::PlatformThread::CurrentId();
29 #endif 29 #endif
30 } 30 }
31 31
32 void ScopedResource::AllocateWithTextureTarget(const gfx::Size& size, 32 void ScopedResource::AllocateWithImageTextureTarget(const gfx::Size& size,
33 GLenum target, 33 ResourceFormat format) {
34 ResourceFormat format) {
35 DCHECK(!id()); 34 DCHECK(!id());
36 DCHECK(!size.IsEmpty()); 35 DCHECK(!size.IsEmpty());
37 36
38 set_dimensions(size, format); 37 set_dimensions(size, format);
39 set_id(resource_provider_->CreateResourceWithTextureTarget( 38 set_id(resource_provider_->CreateResourceWithImageTextureTarget(
40 size, target, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format)); 39 size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format));
41 40
42 #if DCHECK_IS_ON() 41 #if DCHECK_IS_ON()
43 allocate_thread_id_ = base::PlatformThread::CurrentId(); 42 allocate_thread_id_ = base::PlatformThread::CurrentId();
44 #endif 43 #endif
45 } 44 }
46 45
47 void ScopedResource::Free() { 46 void ScopedResource::Free() {
48 if (id()) { 47 if (id()) {
49 #if DCHECK_IS_ON() 48 #if DCHECK_IS_ON()
50 DCHECK(allocate_thread_id_ == base::PlatformThread::CurrentId()); 49 DCHECK(allocate_thread_id_ == base::PlatformThread::CurrentId());
51 #endif 50 #endif
52 resource_provider_->DeleteResource(id()); 51 resource_provider_->DeleteResource(id());
53 } 52 }
54 set_id(0); 53 set_id(0);
55 } 54 }
56 55
57 } // namespace cc 56 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/scoped_resource.h ('k') | cc/test/fake_picture_layer_tiling_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698