diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 20:02:33 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 20:02:33 +0000 |
commit | fd6de706041e07a75c42270a1718bdb789d1e9cd (patch) | |
tree | 79b59e44ff399520b4d2448982edbad4cf260eb8 /cc | |
parent | 9be7ef30339276a7ca46a3d69df3c26fe423f4ce (diff) | |
download | chromium_src-fd6de706041e07a75c42270a1718bdb789d1e9cd.zip chromium_src-fd6de706041e07a75c42270a1718bdb789d1e9cd.tar.gz chromium_src-fd6de706041e07a75c42270a1718bdb789d1e9cd.tar.bz2 |
ResourceProvider::AcquireImage early out if already acquired
If an image resource has been acquired, then calling AcquireImage again
does not need to release and create a new image.
AcquireImage assumptions that no longer hold:
1) The image resource must not be mapped to memory already, since
AcquireImage is no longer going to unmap in this case.
2) The mapped buffer may not be empty.
Currently ImageRasterWorkerPool works with these constraints.
BUG=
Review URL: https://chromiumcodereview.appspot.com/17153005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207524 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/resources/resource_provider.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 57cde87..c3a6c7b 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc @@ -1317,8 +1317,8 @@ void ResourceProvider::AcquireImage(ResourceId id) { if (resource->image_id != 0) { // If we had previously allocated an image for this resource, - // release it before allocating a new one to prevent leaks. - ReleaseImage(id); + // then just reuse same image. + return; } WebGraphicsContext3D* context3d = output_surface_->context3d(); |