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 <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 texture_uploader_->ReleaseCachedQueries(); | 434 texture_uploader_->ReleaseCachedQueries(); |
435 } | 435 } |
436 | 436 |
437 void ResourceProvider::Flush() { | 437 void ResourceProvider::Flush() { |
438 DCHECK(thread_checker_.CalledOnValidThread()); | 438 DCHECK(thread_checker_.CalledOnValidThread()); |
439 WebGraphicsContext3D* context3d = output_surface_->context3d(); | 439 WebGraphicsContext3D* context3d = output_surface_->context3d(); |
440 if (context3d) | 440 if (context3d) |
441 context3d->flush(); | 441 context3d->flush(); |
442 } | 442 } |
443 | 443 |
| 444 void ResourceProvider::Finish() { |
| 445 DCHECK(thread_checker_.CalledOnValidThread()); |
| 446 WebGraphicsContext3D* context3d = output_surface_->context3d(); |
| 447 if (context3d) |
| 448 context3d->finish(); |
| 449 } |
| 450 |
444 bool ResourceProvider::ShallowFlushIfSupported() { | 451 bool ResourceProvider::ShallowFlushIfSupported() { |
445 DCHECK(thread_checker_.CalledOnValidThread()); | 452 DCHECK(thread_checker_.CalledOnValidThread()); |
446 WebGraphicsContext3D* context3d = output_surface_->context3d(); | 453 WebGraphicsContext3D* context3d = output_surface_->context3d(); |
447 if (!context3d || !use_shallow_flush_) | 454 if (!context3d || !use_shallow_flush_) |
448 return false; | 455 return false; |
449 | 456 |
450 context3d->shallowFlushCHROMIUM(); | 457 context3d->shallowFlushCHROMIUM(); |
451 return true; | 458 return true; |
452 } | 459 } |
453 | 460 |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 void ResourceProvider::EnableReadLockFences(ResourceProvider::ResourceId id, | 1231 void ResourceProvider::EnableReadLockFences(ResourceProvider::ResourceId id, |
1225 bool enable) { | 1232 bool enable) { |
1226 DCHECK(thread_checker_.CalledOnValidThread()); | 1233 DCHECK(thread_checker_.CalledOnValidThread()); |
1227 ResourceMap::iterator it = resources_.find(id); | 1234 ResourceMap::iterator it = resources_.find(id); |
1228 CHECK(it != resources_.end()); | 1235 CHECK(it != resources_.end()); |
1229 Resource* resource = &it->second; | 1236 Resource* resource = &it->second; |
1230 resource->enable_read_lock_fences = enable; | 1237 resource->enable_read_lock_fences = enable; |
1231 } | 1238 } |
1232 | 1239 |
1233 } // namespace cc | 1240 } // namespace cc |
OLD | NEW |