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

Side by Side Diff: src/gpu/GrContext.cpp

Issue 1334603002: Revert of Add a mutex to GrContext::readSurfacePixels to protect against multiple CPU raster threads accessin… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 return true; 453 return true;
454 } 454 }
455 455
456 bool GrContext::readSurfacePixels(GrSurface* src, 456 bool GrContext::readSurfacePixels(GrSurface* src,
457 int left, int top, int width, int height, 457 int left, int top, int width, int height,
458 GrPixelConfig dstConfig, void* buffer, size_t rowBytes, 458 GrPixelConfig dstConfig, void* buffer, size_t rowBytes,
459 uint32_t flags) { 459 uint32_t flags) {
460 RETURN_FALSE_IF_ABANDONED 460 RETURN_FALSE_IF_ABANDONED
461 ASSERT_OWNED_RESOURCE(src); 461 ASSERT_OWNED_RESOURCE(src);
462 SkASSERT(src); 462 SkASSERT(src);
463 SkAutoMutexAcquire ama(fReadPixelsMutex); 463
464 // Adjust the params so that if we wind up using an intermediate surface we' ve already done 464 // Adjust the params so that if we wind up using an intermediate surface we' ve already done
465 // all the trimming and the temporary can be the min size required. 465 // all the trimming and the temporary can be the min size required.
466 if (!GrSurfacePriv::AdjustReadPixelParams(src->width(), src->height(), 466 if (!GrSurfacePriv::AdjustReadPixelParams(src->width(), src->height(),
467 GrBytesPerPixel(dstConfig), &left, 467 GrBytesPerPixel(dstConfig), &left,
468 &top, &width, &height, &buffer, &r owBytes)) { 468 &top, &width, &height, &buffer, &r owBytes)) {
469 return false; 469 return false;
470 } 470 }
471 471
472 if (!(kDontFlush_PixelOpsFlag & flags) && src->surfacePriv().hasPendingWrite ()) { 472 if (!(kDontFlush_PixelOpsFlag & flags) && src->surfacePriv().hasPendingWrite ()) {
473 this->flush(); 473 this->flush();
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 744 }
745 if (maxTextureBytes) { 745 if (maxTextureBytes) {
746 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); 746 *maxTextureBytes = fResourceCache->getMaxResourceBytes();
747 } 747 }
748 } 748 }
749 749
750 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) { 750 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes) {
751 fResourceCache->setLimits(maxTextures, maxTextureBytes); 751 fResourceCache->setLimits(maxTextures, maxTextureBytes);
752 } 752 }
753 753
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698