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

Side by Side Diff: gm/SkLinearBitmapPipelineGM.cpp

Issue 1760123003: Add support for new bitmapshader context (patchset #5 id:80001 of https://codereview.chromium.org/1… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox 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 | « bench/SkLinearBitmapPipelineBench.cpp ('k') | src/core/SkBitmapProcShader.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 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkAutoTUnref<SkImage> image{SkImage::NewRasterCopy(
61 info, pmsrc.addr32(), pmsrc.rowBytes())}; 61 info, pmsrc.addr32(), pmsrc.rowBytes())};
62 SkPaint paint; 62 SkPaint paint;
63 int32_t storage[200]; 63 int32_t storage[300];
64 SkShader* shader = image->newShader(SkShader::kClamp_TileMode, SkShader::kCl amp_TileMode); 64 SkShader* shader = image->newShader(SkShader::kClamp_TileMode, SkShader::kCl amp_TileMode);
65 if (useBilerp) { 65 if (useBilerp) {
66 paint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality); 66 paint.setFilterQuality(SkFilterQuality::kLow_SkFilterQuality);
67 } else { 67 } else {
68 paint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality); 68 paint.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality);
69 } 69 }
70 paint.setShader(shader)->unref(); 70 paint.setShader(shader)->unref();
71 const SkShader::ContextRec rec(paint, *mat, nullptr, 71 const SkShader::ContextRec rec(paint, *mat, nullptr,
72 SkBlitter::PreferredShaderDest(pmsrc.info())) ; 72 SkBlitter::PreferredShaderDest(pmsrc.info())) ;
73 SkASSERT(paint.getShader()->contextSize(rec) <= sizeof(storage)); 73 SkASSERT(paint.getShader()->contextSize(rec) <= sizeof(storage));
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 canvas->restore(); 195 canvas->restore();
196 canvas->translate(0, H + 20); 196 canvas->translate(0, H + 20);
197 } 197 }
198 canvas->restore(); 198 canvas->restore();
199 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats)); 199 canvas->translate(0, (H + 20) * SK_ARRAY_COUNT(mats));
200 if (useBilerp) break; 200 if (useBilerp) break;
201 useBilerp = true; 201 useBilerp = true;
202 } 202 }
203 } 203 }
OLDNEW
« no previous file with comments | « bench/SkLinearBitmapPipelineBench.cpp ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698