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

Side by Side Diff: gm/image.cpp

Issue 1505333002: SkBitmap::installPixels(const SkPixmap&); (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-09 (Wednesday) 13:58:05 EST Created 5 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
« no previous file with comments | « bench/ImageBench.cpp ('k') | include/core/SkBitmap.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 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 "gm.h" 8 #include "gm.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 typedef skiagm::GM INHERITED; 192 typedef skiagm::GM INHERITED;
193 }; 193 };
194 DEF_GM( return new ImageGM; ) 194 DEF_GM( return new ImageGM; )
195 195
196 //////////////////////////////////////////////////////////////////////////////// /////////////////// 196 //////////////////////////////////////////////////////////////////////////////// ///////////////////
197 197
198 #include "SkPictureRecorder.h" 198 #include "SkPictureRecorder.h"
199 199
200 static void draw_pixmap(SkCanvas* canvas, const SkPixmap& pmap) { 200 static void draw_pixmap(SkCanvas* canvas, const SkPixmap& pmap) {
201 SkBitmap bitmap; 201 SkBitmap bitmap;
202 bitmap.installPixels(pmap.info(), (void*)pmap.addr(), pmap.rowBytes()); 202 bitmap.installPixels(pmap);
203 canvas->drawBitmap(bitmap, 0, 0, nullptr); 203 canvas->drawBitmap(bitmap, 0, 0, nullptr);
204 } 204 }
205 205
206 static void show_scaled_pixels(SkCanvas* canvas, SkImage* image) { 206 static void show_scaled_pixels(SkCanvas* canvas, SkImage* image) {
207 SkAutoCanvasRestore acr(canvas, true); 207 SkAutoCanvasRestore acr(canvas, true);
208 208
209 canvas->drawImage(image, 0, 0, nullptr); 209 canvas->drawImage(image, 0, 0, nullptr);
210 canvas->translate(110, 10); 210 canvas->translate(110, 10);
211 211
212 const SkImageInfo info = SkImageInfo::MakeN32Premul(40, 40); 212 const SkImageInfo info = SkImageInfo::MakeN32Premul(40, 40);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 show_scaled_generator(canvas, gen); 422 show_scaled_generator(canvas, gen);
423 } 423 }
424 canvas->translate(0, 120); 424 canvas->translate(0, 120);
425 } 425 }
426 } 426 }
427 427
428 private: 428 private:
429 typedef skiagm::GM INHERITED; 429 typedef skiagm::GM INHERITED;
430 }; 430 };
431 DEF_GM( return new ScaleGeneratorGM; ) 431 DEF_GM( return new ScaleGeneratorGM; )
OLDNEW
« no previous file with comments | « bench/ImageBench.cpp ('k') | include/core/SkBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698