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

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

Issue 2324473002: Move prepareForExternalIO implementation from GrContext to GrDrawingManager (Closed)
Patch Set: Created 4 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 | « no previous file | src/gpu/GrDrawContext.cpp » ('j') | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrContext.h" 8 #include "GrContext.h"
9 #include "GrContextPriv.h" 9 #include "GrContextPriv.h"
10 #include "GrContextOptions.h" 10 #include "GrContextOptions.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 return srcPI.convertPixelsTo(&dstPI, width, height); 511 return srcPI.convertPixelsTo(&dstPI, width, height);
512 } 512 }
513 return true; 513 return true;
514 } 514 }
515 515
516 void GrContext::prepareSurfaceForExternalIO(GrSurface* surface) { 516 void GrContext::prepareSurfaceForExternalIO(GrSurface* surface) {
517 ASSERT_SINGLE_OWNER 517 ASSERT_SINGLE_OWNER
518 RETURN_IF_ABANDONED 518 RETURN_IF_ABANDONED
519 SkASSERT(surface); 519 SkASSERT(surface);
520 ASSERT_OWNED_RESOURCE(surface); 520 ASSERT_OWNED_RESOURCE(surface);
521 if (surface->surfacePriv().hasPendingIO()) { 521 fDrawingManager->prepareSurfaceForExternalIO(surface);
522 this->flush();
523 }
524 GrRenderTarget* rt = surface->asRenderTarget();
525 if (fGpu && rt) {
526 fGpu->resolveRenderTarget(rt);
527 }
528 } 522 }
529 523
530 bool GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe ct, 524 bool GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe ct,
531 const SkIPoint& dstPoint) { 525 const SkIPoint& dstPoint) {
532 ASSERT_SINGLE_OWNER 526 ASSERT_SINGLE_OWNER
533 RETURN_FALSE_IF_ABANDONED 527 RETURN_FALSE_IF_ABANDONED
534 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::copySurface"); 528 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::copySurface");
535 529
536 if (!src || !dst) { 530 if (!src || !dst) {
537 return false; 531 return false;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 ASSERT_SINGLE_OWNER 830 ASSERT_SINGLE_OWNER
837 fResourceCache->setLimits(maxTextures, maxTextureBytes); 831 fResourceCache->setLimits(maxTextures, maxTextureBytes);
838 } 832 }
839 833
840 ////////////////////////////////////////////////////////////////////////////// 834 //////////////////////////////////////////////////////////////////////////////
841 835
842 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 836 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
843 ASSERT_SINGLE_OWNER 837 ASSERT_SINGLE_OWNER
844 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 838 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
845 } 839 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698