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

Side by Side Diff: tests/ReadPixelsTest.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « tests/PaintTest.cpp ('k') | tests/RecordDrawTest.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 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkMathPriv.h" 10 #include "SkMathPriv.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 } 107 }
108 return bmp; 108 return bmp;
109 } 109 }
110 110
111 static void fill_src_canvas(SkCanvas* canvas) { 111 static void fill_src_canvas(SkCanvas* canvas) {
112 canvas->save(); 112 canvas->save();
113 canvas->setMatrix(SkMatrix::I()); 113 canvas->setMatrix(SkMatrix::I());
114 canvas->clipRect(DEV_RECT_S, SkCanvas::kReplace_Op); 114 canvas->clipRect(DEV_RECT_S, SkCanvas::kReplace_Op);
115 SkPaint paint; 115 SkPaint paint;
116 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 116 paint.setBlendMode(SkBlendMode::kSrc);
117 canvas->drawBitmap(make_src_bitmap(), 0, 0, &paint); 117 canvas->drawBitmap(make_src_bitmap(), 0, 0, &paint);
118 canvas->restore(); 118 canvas->restore();
119 } 119 }
120 120
121 #if SK_SUPPORT_GPU 121 #if SK_SUPPORT_GPU
122 static void fill_src_texture(GrTexture* texture) { 122 static void fill_src_texture(GrTexture* texture) {
123 SkBitmap bmp = make_src_bitmap(); 123 SkBitmap bmp = make_src_bitmap();
124 bmp.lockPixels(); 124 bmp.lockPixels();
125 texture->writePixels(0, 0, DEV_W, DEV_H, kSkia8888_GrPixelConfig, bmp.getPix els(), 125 texture->writePixels(0, 0, DEV_W, DEV_H, kSkia8888_GrPixelConfig, bmp.getPix els(),
126 bmp.rowBytes()); 126 bmp.rowBytes());
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 desc.fHeight = DEV_H; 443 desc.fHeight = DEV_H;
444 desc.fConfig = kSkia8888_GrPixelConfig; 444 desc.fConfig = kSkia8888_GrPixelConfig;
445 desc.fOrigin = origin; 445 desc.fOrigin = origin;
446 desc.fFlags = kNone_GrSurfaceFlags; 446 desc.fFlags = kNone_GrSurfaceFlags;
447 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc , 447 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc ,
448 SkBu dgeted::kNo)); 448 SkBu dgeted::kNo));
449 test_readpixels_texture(reporter, texture); 449 test_readpixels_texture(reporter, texture);
450 } 450 }
451 } 451 }
452 #endif 452 #endif
OLDNEW
« no previous file with comments | « tests/PaintTest.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698