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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 791823003: Add sRGB texture support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add in changes for copy_to_new_texture_pixelref Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (fCurContext) { 294 if (fCurContext) {
295 // in case we have queued drawing calls 295 // in case we have queued drawing calls
296 fCurContext->flush(); 296 fCurContext->flush();
297 297
298 if (!IsGpuDeviceType(dType)) { 298 if (!IsGpuDeviceType(dType)) {
299 // need to send the raster bits to the (gpu) window 299 // need to send the raster bits to the (gpu) window
300 fCurContext->setRenderTarget(fCurRenderTarget); 300 fCurContext->setRenderTarget(fCurRenderTarget);
301 const SkBitmap& bm = win->getBitmap(); 301 const SkBitmap& bm = win->getBitmap();
302 fCurRenderTarget->writePixels(0, 0, bm.width(), bm.height(), 302 fCurRenderTarget->writePixels(0, 0, bm.width(), bm.height(),
303 SkImageInfo2GrPixelConfig(bm.colorT ype(), 303 SkImageInfo2GrPixelConfig(bm.colorT ype(),
304 bm.alphaT ype()), 304 bm.alphaT ype(),
305 bm.profil eType()),
305 bm.getPixels(), 306 bm.getPixels(),
306 bm.rowBytes(), 307 bm.rowBytes(),
307 GrContext::kFlushWrites_PixelOp); 308 GrContext::kFlushWrites_PixelOp);
308 } 309 }
309 } 310 }
310 #endif 311 #endif
311 312
312 win->present(); 313 win->present();
313 } 314 }
314 315
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 setenv("ANDROID_ROOT", "/android/device/data", 0); 2434 setenv("ANDROID_ROOT", "/android/device/data", 0);
2434 #endif 2435 #endif
2435 SkGraphics::Init(); 2436 SkGraphics::Init();
2436 SkEvent::Init(); 2437 SkEvent::Init();
2437 } 2438 }
2438 2439
2439 void application_term() { 2440 void application_term() {
2440 SkEvent::Term(); 2441 SkEvent::Term();
2441 SkGraphics::Term(); 2442 SkGraphics::Term();
2442 } 2443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698