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

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

Issue 14689004: Re-land: cc: Cancel and re-prioritize worker pool tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check and prevent worker pool reentrancy during dispatch of completion callbacks Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | cc/resources/tile_manager.h » ('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/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/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 WebGraphicsContext3D* context3d = output_surface_->context3d(); 974 WebGraphicsContext3D* context3d = output_surface_->context3d();
975 DCHECK(context3d); 975 DCHECK(context3d);
976 DCHECK(resource->gl_pixel_buffer_id); 976 DCHECK(resource->gl_pixel_buffer_id);
977 context3d->bindBuffer( 977 context3d->bindBuffer(
978 GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 978 GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM,
979 resource->gl_pixel_buffer_id); 979 resource->gl_pixel_buffer_id);
980 uint8_t* image = static_cast<uint8_t*>( 980 uint8_t* image = static_cast<uint8_t*>(
981 context3d->mapBufferCHROMIUM( 981 context3d->mapBufferCHROMIUM(
982 GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, GL_WRITE_ONLY)); 982 GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, GL_WRITE_ONLY));
983 context3d->bindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 0); 983 context3d->bindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 0);
984 // Buffer is required to be 4-byte aligned.
985 CHECK(!(reinterpret_cast<intptr_t>(image) & 3));
984 return image; 986 return image;
985 } 987 }
986 988
987 if (resource->pixels) 989 if (resource->pixels)
988 return resource->pixel_buffer; 990 return resource->pixel_buffer;
989 991
990 return NULL; 992 return NULL;
991 } 993 }
992 994
993 void ResourceProvider::UnmapPixelBuffer(ResourceId id) { 995 void ResourceProvider::UnmapPixelBuffer(ResourceId id) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 WebGraphicsContext3D* context3d = output_surface_->context3d(); 1367 WebGraphicsContext3D* context3d = output_surface_->context3d();
1366 DCHECK(context3d); 1368 DCHECK(context3d);
1367 int stride = 0; 1369 int stride = 0;
1368 context3d->getImageParameterivCHROMIUM( 1370 context3d->getImageParameterivCHROMIUM(
1369 resource->image_id, GL_IMAGE_ROWBYTES_CHROMIUM, &stride); 1371 resource->image_id, GL_IMAGE_ROWBYTES_CHROMIUM, &stride);
1370 return stride; 1372 return stride;
1371 } 1373 }
1372 1374
1373 1375
1374 } // namespace cc 1376 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698