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

Side by Side Diff: include/gpu/GrSurface.h

Issue 648863002: Devirtualize read/write pixels on surface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify return 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 | « include/gpu/GrRenderTarget.h ('k') | include/gpu/GrTexture.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 /* 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 8
9 #ifndef GrSurface_DEFINED 9 #ifndef GrSurface_DEFINED
10 #define GrSurface_DEFINED 10 #define GrSurface_DEFINED
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 * @param height height of rectangle to read in pixels. 80 * @param height height of rectangle to read in pixels.
81 * @param config the pixel config of the destination buffer 81 * @param config the pixel config of the destination buffer
82 * @param buffer memory to read the rectangle into. 82 * @param buffer memory to read the rectangle into.
83 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly 83 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly
84 * packed. 84 * packed.
85 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. 85 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
86 * 86 *
87 * @return true if the read succeeded, false if not. The read can fail becau se of an unsupported 87 * @return true if the read succeeded, false if not. The read can fail becau se of an unsupported
88 * pixel config. 88 * pixel config.
89 */ 89 */
90 virtual bool readPixels(int left, int top, int width, int height, 90 bool readPixels(int left, int top, int width, int height,
91 GrPixelConfig config, 91 GrPixelConfig config,
92 void* buffer, 92 void* buffer,
93 size_t rowBytes = 0, 93 size_t rowBytes = 0,
94 uint32_t pixelOpsFlags = 0) = 0; 94 uint32_t pixelOpsFlags = 0);
95 95
96 /** 96 /**
97 * Copy the src pixels [buffer, rowbytes, pixelconfig] into the surface at t he specified 97 * Copy the src pixels [buffer, rowbytes, pixelconfig] into the surface at t he specified
98 * rectangle. 98 * rectangle.
99 * @param left left edge of the rectangle to write (inclusive) 99 * @param left left edge of the rectangle to write (inclusive)
100 * @param top top edge of the rectangle to write (inclusive) 100 * @param top top edge of the rectangle to write (inclusive)
101 * @param width width of rectangle to write in pixels. 101 * @param width width of rectangle to write in pixels.
102 * @param height height of rectangle to write in pixels. 102 * @param height height of rectangle to write in pixels.
103 * @param config the pixel config of the source buffer 103 * @param config the pixel config of the source buffer
104 * @param buffer memory to read the rectangle from. 104 * @param buffer memory to read the rectangle from.
105 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly 105 * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly
106 * packed. 106 * packed.
107 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. 107 * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
108 */ 108 */
109 virtual void writePixels(int left, int top, int width, int height, 109 bool writePixels(int left, int top, int width, int height,
110 GrPixelConfig config, 110 GrPixelConfig config,
111 const void* buffer, 111 const void* buffer,
112 size_t rowBytes = 0, 112 size_t rowBytes = 0,
113 uint32_t pixelOpsFlags = 0) = 0; 113 uint32_t pixelOpsFlags = 0);
114 114
115 /** 115 /**
116 * After this returns any pending writes to the surface will be issued to th e backend 3D API. 116 * After this returns any pending writes to the surface will be issued to th e backend 3D API.
117 */ 117 */
118 void flushWrites(); 118 void flushWrites();
119 119
120 /** Access methods that are only to be used within Skia code. */ 120 /** Access methods that are only to be used within Skia code. */
121 inline GrSurfacePriv surfacePriv(); 121 inline GrSurfacePriv surfacePriv();
122 inline const GrSurfacePriv surfacePriv() const; 122 inline const GrSurfacePriv surfacePriv() const;
123 123
(...skipping 14 matching lines...) Expand all
138 , fDesc(desc) { 138 , fDesc(desc) {
139 } 139 }
140 140
141 GrTextureDesc fDesc; 141 GrTextureDesc fDesc;
142 142
143 private: 143 private:
144 typedef GrGpuResource INHERITED; 144 typedef GrGpuResource INHERITED;
145 }; 145 };
146 146
147 #endif 147 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | include/gpu/GrTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698