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

Side by Side Diff: gm/SkLinearBitmapPipelineGM.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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 | « example/HelloWorld.cpp ('k') | gm/all_bitmap_configs.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 2016 Google Inc. 2 * Copyright 2016 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 "SkBlitter.h" 9 #include "SkBlitter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 bmsrc.peekPixels(&pmsrc); 50 bmsrc.peekPixels(&pmsrc);
51 51
52 SkBitmap bmdst; 52 SkBitmap bmdst;
53 bmdst.allocN32Pixels(ir.width(), ir.height()); 53 bmdst.allocN32Pixels(ir.width(), ir.height());
54 bmdst.eraseColor(0xFFFFFFFF); 54 bmdst.eraseColor(0xFFFFFFFF);
55 SkPixmap pmdst; 55 SkPixmap pmdst;
56 bmdst.peekPixels(&pmdst); 56 bmdst.peekPixels(&pmdst);
57 57
58 SkImageInfo info = SkImageInfo::MakeN32Premul(ir.width(), ir.height(), kLine ar_SkColorProfileType); 58 SkImageInfo info = SkImageInfo::MakeN32Premul(ir.width(), ir.height(), kLine ar_SkColorProfileType);
59 59
60 SkAutoTUnref<SkImage> image{SkImage::NewRasterCopy( 60 sk_sp<SkImage> image(SkImage::MakeRasterCopy(SkPixmap(info, pmsrc.addr32(), pmsrc.rowBytes())));
61 info, pmsrc.addr32(), pmsrc.rowBytes())};
62 SkPaint paint; 61 SkPaint paint;
63 int32_t storage[300]; 62 int32_t storage[300];
64 paint.setShader(image->makeShader(SkShader::kClamp_TileMode, SkShader::kClam p_TileMode)); 63 paint.setShader(image->makeShader(SkShader::kClamp_TileMode, SkShader::kClam p_TileMode));
65 if (useBilerp) { 64 if (useBilerp) {
66 paint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality); 65 paint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality);
67 } else { 66 } else {
68 paint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality); 67 paint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality);
69 } 68 }
70 const SkShader::ContextRec rec(paint, *mat, nullptr, 69 const SkShader::ContextRec rec(paint, *mat, nullptr,
71 SkBlitter::PreferredShaderDest(pmsrc.info())) ; 70 SkBlitter::PreferredShaderDest(pmsrc.info())) ;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 192 }
194 canvas->restore(); 193 canvas->restore();
195 canvas->translate(0, H + 20); 194 canvas->translate(0, H + 20);
196 } 195 }
197 canvas->restore(); 196 canvas->restore();
198 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); 197 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats));
199 if (useBilerp) break; 198 if (useBilerp) break;
200 useBilerp = true; 199 useBilerp = true;
201 } 200 }
202 } 201 }
OLDNEW
« no previous file with comments | « example/HelloWorld.cpp ('k') | gm/all_bitmap_configs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698