| OLD | NEW |
| 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 Loading... |
| 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); |
| OLD | NEW |