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

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

Issue 586073002: Don't flush on read/write pixels unless necessary (Closed) Base URL: https://skia.googlesource.com/skia.git@iotype
Patch Set: Flush when drawing direct to GrGpu in GrContext Created 6 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 | « src/gpu/GrInOrderDrawBuffer.cpp ('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 * 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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 26 matching lines...) Expand all
37 remove(filename); 37 remove(filename);
38 38
39 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) { 39 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) {
40 SkDebugf("------ failed to encode %s\n", filename); 40 SkDebugf("------ failed to encode %s\n", filename);
41 remove(filename); // remove any partial file 41 remove(filename); // remove any partial file
42 return false; 42 return false;
43 } 43 }
44 44
45 return true; 45 return true;
46 } 46 }
47
48 bool GrSurface::hasPendingRead() const {
49 const GrTexture* thisTex = this->asTexture();
50 if (thisTex && thisTex->internalHasPendingRead()) {
51 return true;
52 }
53 const GrRenderTarget* thisRT = this->asRenderTarget();
54 if (thisRT && thisRT->internalHasPendingRead()) {
55 return true;
56 }
57 return false;
58 }
59
60 bool GrSurface::hasPendingWrite() const {
61 const GrTexture* thisTex = this->asTexture();
62 if (thisTex && thisTex->internalHasPendingWrite()) {
63 return true;
64 }
65 const GrRenderTarget* thisRT = this->asRenderTarget();
66 if (thisRT && thisRT->internalHasPendingWrite()) {
67 return true;
68 }
69 return false;
70 }
71
72 bool GrSurface::hasPendingIO() const {
73 const GrTexture* thisTex = this->asTexture();
74 if (thisTex && thisTex->internalHasPendingIO()) {
75 return true;
76 }
77 const GrRenderTarget* thisRT = this->asRenderTarget();
78 if (thisRT && thisRT->internalHasPendingIO()) {
79 return true;
80 }
81 return false;
82 }
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698