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

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

Issue 622663002: GrContext::copyTexture->GrContext::copySurface. Add a flush writes pixel ops flag. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 2 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/SkGrPixelRef.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 2012 Google Inc. 2 * Copyright 2012 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 "GrSurface.h" 8 #include "GrSurface.h"
9 #include "GrSurfacePriv.h" 9 #include "GrSurfacePriv.h"
10 10
(...skipping 30 matching lines...) Expand all
41 41
42 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) { 42 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) {
43 SkDebugf("------ failed to encode %s\n", filename); 43 SkDebugf("------ failed to encode %s\n", filename);
44 remove(filename); // remove any partial file 44 remove(filename); // remove any partial file
45 return false; 45 return false;
46 } 46 }
47 47
48 return true; 48 return true;
49 } 49 }
50 50
51 void GrSurface::flushWrites() {
52 if (!this->wasDestroyed()) {
53 this->getContext()->flushSurfaceWrites(this);
54 }
55 }
56
51 bool GrSurface::hasPendingRead() const { 57 bool GrSurface::hasPendingRead() const {
52 const GrTexture* thisTex = this->asTexture(); 58 const GrTexture* thisTex = this->asTexture();
53 if (thisTex && thisTex->internalHasPendingRead()) { 59 if (thisTex && thisTex->internalHasPendingRead()) {
54 return true; 60 return true;
55 } 61 }
56 const GrRenderTarget* thisRT = this->asRenderTarget(); 62 const GrRenderTarget* thisRT = this->asRenderTarget();
57 if (thisRT && thisRT->internalHasPendingRead()) { 63 if (thisRT && thisRT->internalHasPendingRead()) {
58 return true; 64 return true;
59 } 65 }
60 return false; 66 return false;
(...skipping 26 matching lines...) Expand all
87 bool GrSurface::isSameAs(const GrSurface* other) const { 93 bool GrSurface::isSameAs(const GrSurface* other) const {
88 const GrRenderTarget* thisRT = this->asRenderTarget(); 94 const GrRenderTarget* thisRT = this->asRenderTarget();
89 if (thisRT) { 95 if (thisRT) {
90 return thisRT == other->asRenderTarget(); 96 return thisRT == other->asRenderTarget();
91 } else { 97 } else {
92 const GrTexture* thisTex = this->asTexture(); 98 const GrTexture* thisTex = this->asTexture();
93 SkASSERT(thisTex); // We must be one or the other 99 SkASSERT(thisTex); // We must be one or the other
94 return thisTex == other->asTexture(); 100 return thisTex == other->asTexture();
95 } 101 }
96 } 102 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698