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

Side by Side Diff: tests/ReadPixelsTest.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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/PictureTest.cpp ('k') | tests/SkLiteDLTest.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"
11 #include "SkRegion.h"
12 #include "SkSurface.h" 11 #include "SkSurface.h"
13 #include "Test.h" 12 #include "Test.h"
14 13
15 #if SK_SUPPORT_GPU 14 #if SK_SUPPORT_GPU
16 #include "GrContext.h" 15 #include "GrContext.h"
17 #include "SkGr.h" 16 #include "SkGr.h"
18 #endif 17 #endif
19 18
20 #include <initializer_list> 19 #include <initializer_list>
21 20
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 *pixel = get_src_color(x, y); 104 *pixel = get_src_color(x, y);
106 } 105 }
107 } 106 }
108 } 107 }
109 return bmp; 108 return bmp;
110 } 109 }
111 110
112 static void fill_src_canvas(SkCanvas* canvas) { 111 static void fill_src_canvas(SkCanvas* canvas) {
113 canvas->save(); 112 canvas->save();
114 canvas->setMatrix(SkMatrix::I()); 113 canvas->setMatrix(SkMatrix::I());
115 canvas->clipRect(DEV_RECT_S, SkRegion::kReplace_Op); 114 canvas->clipRect(DEV_RECT_S, SkCanvas::kReplace_Op);
116 SkPaint paint; 115 SkPaint paint;
117 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 116 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
118 canvas->drawBitmap(make_src_bitmap(), 0, 0, &paint); 117 canvas->drawBitmap(make_src_bitmap(), 0, 0, &paint);
119 canvas->restore(); 118 canvas->restore();
120 } 119 }
121 120
122 #if SK_SUPPORT_GPU 121 #if SK_SUPPORT_GPU
123 static void fill_src_texture(GrTexture* texture) { 122 static void fill_src_texture(GrTexture* texture) {
124 SkBitmap bmp = make_src_bitmap(); 123 SkBitmap bmp = make_src_bitmap();
125 bmp.lockPixels(); 124 bmp.lockPixels();
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 desc.fHeight = DEV_H; 443 desc.fHeight = DEV_H;
445 desc.fConfig = kSkia8888_GrPixelConfig; 444 desc.fConfig = kSkia8888_GrPixelConfig;
446 desc.fOrigin = origin; 445 desc.fOrigin = origin;
447 desc.fFlags = kNone_GrSurfaceFlags; 446 desc.fFlags = kNone_GrSurfaceFlags;
448 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc , 447 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc ,
449 SkBu dgeted::kNo)); 448 SkBu dgeted::kNo));
450 test_readpixels_texture(reporter, texture); 449 test_readpixels_texture(reporter, texture);
451 } 450 }
452 } 451 }
453 #endif 452 #endif
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/SkLiteDLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698