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

Side by Side Diff: gm/arithmode.cpp

Issue 16034013: Remove unpremul/remul from SkArithmeticMode, both raster and GPU, since the SVG spec actually defin… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix keygen. Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/xfermodeimagefilter.cpp » ('j') | include/effects/SkArithmeticMode.h » ('J')
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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SkScalar gap = SkIntToScalar(src.width() + 20); 104 SkScalar gap = SkIntToScalar(src.width() + 20);
105 while (k < stop) { 105 while (k < stop) {
106 SkScalar x = 0; 106 SkScalar x = 0;
107 canvas->drawBitmap(src, x, y, NULL); 107 canvas->drawBitmap(src, x, y, NULL);
108 x += gap; 108 x += gap;
109 canvas->drawBitmap(dst, x, y, NULL); 109 canvas->drawBitmap(dst, x, y, NULL);
110 x += gap; 110 x += gap;
111 SkRect rect = SkRect::MakeXYWH(x, y, SkIntToScalar(WW), SkIntToScala r(HH)); 111 SkRect rect = SkRect::MakeXYWH(x, y, SkIntToScalar(WW), SkIntToScala r(HH));
112 canvas->saveLayer(&rect, NULL); 112 canvas->saveLayer(&rect, NULL);
113 canvas->drawBitmap(dst, x, y, NULL); 113 canvas->drawBitmap(dst, x, y, NULL);
114 SkXfermode* xfer = SkArithmeticMode::Create(k[0], k[1], k[2], k[3]); 114 SkXfermode* xfer = SkArithmeticMode::Create(k[0], k[1], k[2], k[3], true);
115 SkPaint paint; 115 SkPaint paint;
116 paint.setXfermode(xfer)->unref(); 116 paint.setXfermode(xfer)->unref();
117 canvas->drawBitmap(src, x, y, &paint); 117 canvas->drawBitmap(src, x, y, &paint);
118 canvas->restore(); 118 canvas->restore();
119 x += gap; 119 x += gap;
120 show_k_text(canvas, x, y, k); 120 show_k_text(canvas, x, y, k);
121 k += 4; 121 k += 4;
122 y += SkIntToScalar(src.height() + 12); 122 y += SkIntToScalar(src.height() + 12);
123 } 123 }
124 } 124 }
125 125
126 private: 126 private:
127 typedef GM INHERITED; 127 typedef GM INHERITED;
128 }; 128 };
129 129
130 /////////////////////////////////////////////////////////////////////////////// 130 ///////////////////////////////////////////////////////////////////////////////
131 131
132 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } 132 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; }
133 static skiagm::GMRegistry reg(MyFactory); 133 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | gm/xfermodeimagefilter.cpp » ('j') | include/effects/SkArithmeticMode.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698