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

Side by Side Diff: example/HelloWorld.cpp

Issue 1636873002: There is an unused rowBytes parameter being passed along. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Accidentally left in test code. Created 4 years, 10 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/GrContext.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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
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 9
10 #include "HelloWorld.h" 10 #include "HelloWorld.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void HelloWorldWindow::draw(SkCanvas* canvas) { 150 void HelloWorldWindow::draw(SkCanvas* canvas) {
151 drawContents(canvas); 151 drawContents(canvas);
152 // in case we have queued drawing calls 152 // in case we have queued drawing calls
153 fContext->flush(); 153 fContext->flush();
154 // Invalidate the window to force a redraw. Poor man's animation mechanism. 154 // Invalidate the window to force a redraw. Poor man's animation mechanism.
155 this->inval(NULL); 155 this->inval(NULL);
156 156
157 if (kRaster_DeviceType == fType) { 157 if (kRaster_DeviceType == fType) {
158 // need to send the raster bits to the (gpu) window 158 // need to send the raster bits to the (gpu) window
159 SkImage* snap = fSurface->newImageSnapshot(); 159 SkImage* snap = fSurface->newImageSnapshot();
160 size_t rowBytes; 160 size_t rowBytes = 0;
161 SkImageInfo info; 161 SkImageInfo info;
162 const void* pixels = snap->peekPixels(&info, &rowBytes); 162 const void* pixels = snap->peekPixels(&info, &rowBytes);
163 fRenderTarget->writePixels(0, 0, snap->width(), snap->height(), 163 fRenderTarget->writePixels(0, 0, snap->width(), snap->height(),
164 SkImageInfo2GrPixelConfig(info.colorType (), 164 SkImageInfo2GrPixelConfig(info.colorType (),
165 info.alphaType() , 165 info.alphaType() ,
166 info.profileType ()), 166 info.profileType ()),
167 pixels, 167 pixels,
168 rowBytes, 168 rowBytes,
169 GrContext::kFlushWrites_PixelOp); 169 GrContext::kFlushWrites_PixelOp);
170 SkSafeUnref(snap); 170 SkSafeUnref(snap);
(...skipping 12 matching lines...) Expand all
183 setUpBackend(); 183 setUpBackend();
184 this->setTitle(); 184 this->setTitle();
185 this->inval(NULL); 185 this->inval(NULL);
186 } 186 }
187 return true; 187 return true;
188 } 188 }
189 189
190 SkOSWindow* create_sk_window(void* hwnd, int , char** ) { 190 SkOSWindow* create_sk_window(void* hwnd, int , char** ) {
191 return new HelloWorldWindow(hwnd); 191 return new HelloWorldWindow(hwnd);
192 } 192 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698