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

Side by Side Diff: example/HelloWorld.cpp

Issue 1789663002: sRGB support in Ganesh. Several pieces: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Squelch assert when blurring sRGB Created 4 years, 9 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 | include/gpu/GrCaps.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 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 150
151 if (kRaster_DeviceType == fType) { 151 if (kRaster_DeviceType == fType) {
152 // need to send the raster bits to the (gpu) window 152 // need to send the raster bits to the (gpu) window
153 sk_sp<SkImage> snap = fSurface->makeImageSnapshot(); 153 sk_sp<SkImage> snap = fSurface->makeImageSnapshot();
154 SkPixmap pmap; 154 SkPixmap pmap;
155 if (snap->peekPixels(&pmap)) { 155 if (snap->peekPixels(&pmap)) {
156 const SkImageInfo& info = pmap.info(); 156 const SkImageInfo& info = pmap.info();
157 fRenderTarget->writePixels(0, 0, snap->width(), snap->height(), 157 fRenderTarget->writePixels(0, 0, snap->width(), snap->height(),
158 SkImageInfo2GrPixelConfig(info.color Type(), 158 SkImageInfo2GrPixelConfig(info.color Type(),
159 info.alphaTy pe(), 159 info.alphaTy pe(),
160 info.profile Type()), 160 info.profile Type(),
161 *fContext->c aps()),
161 pmap.addr(), 162 pmap.addr(),
162 pmap.rowBytes(), 163 pmap.rowBytes(),
163 GrContext::kFlushWrites_PixelOp); 164 GrContext::kFlushWrites_PixelOp);
164 } 165 }
165 } 166 }
166 INHERITED::present(); 167 INHERITED::present();
167 } 168 }
168 169
169 void HelloWorldWindow::onSizeChange() { 170 void HelloWorldWindow::onSizeChange() {
170 setUpRenderTarget(); 171 setUpRenderTarget();
171 } 172 }
172 173
173 bool HelloWorldWindow::onHandleChar(SkUnichar unichar) { 174 bool HelloWorldWindow::onHandleChar(SkUnichar unichar) {
174 if (' ' == unichar) { 175 if (' ' == unichar) {
175 fType = fType == kRaster_DeviceType ? kGPU_DeviceType: kRaster_DeviceTyp e; 176 fType = fType == kRaster_DeviceType ? kGPU_DeviceType: kRaster_DeviceTyp e;
176 tearDownBackend(); 177 tearDownBackend();
177 setUpBackend(); 178 setUpBackend();
178 this->setTitle(); 179 this->setTitle();
179 this->inval(NULL); 180 this->inval(NULL);
180 } 181 }
181 return true; 182 return true;
182 } 183 }
183 184
184 SkOSWindow* create_sk_window(void* hwnd, int , char** ) { 185 SkOSWindow* create_sk_window(void* hwnd, int , char** ) {
185 return new HelloWorldWindow(hwnd); 186 return new HelloWorldWindow(hwnd);
186 } 187 }
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698