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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 300263005: Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/3044430… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « tests/CachedDecodingPixelRefTest.cpp ('k') | tests/DrawBitmapRectTest.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 2012 Google Inc. 2 * Copyright 2012 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 "../src/image/SkImagePriv.h" 8 #include "../src/image/SkImagePriv.h"
9 #include "../src/image/SkSurface_Base.h" 9 #include "../src/image/SkSurface_Base.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 22 matching lines...) Expand all
33 33
34 static SkSurface* createSurface(SkColor color) { 34 static SkSurface* createSurface(SkColor color) {
35 SkSurface* surface = SkSurface::NewRasterPMColor(gWidth, gHeight); 35 SkSurface* surface = SkSurface::NewRasterPMColor(gWidth, gHeight);
36 surface->getCanvas()->clear(color); 36 surface->getCanvas()->clear(color);
37 return surface; 37 return surface;
38 } 38 }
39 39
40 static SkPMColor read_pixel(SkSurface* surface, int x, int y) { 40 static SkPMColor read_pixel(SkSurface* surface, int x, int y) {
41 SkPMColor pixel = 0; 41 SkPMColor pixel = 0;
42 SkBitmap bitmap; 42 SkBitmap bitmap;
43 bitmap.installPixels(SkImageInfo::MakeN32Premul(1, 1), &pixel, 4, NULL, NULL ); 43 bitmap.installPixels(SkImageInfo::MakeN32Premul(1, 1), &pixel, 4);
44 SkCanvas canvas(bitmap); 44 SkCanvas canvas(bitmap);
45 45
46 SkPaint paint; 46 SkPaint paint;
47 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 47 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
48 surface->draw(&canvas, -SkIntToScalar(x), -SkIntToScalar(y), &paint); 48 surface->draw(&canvas, -SkIntToScalar(x), -SkIntToScalar(y), &paint);
49 return pixel; 49 return pixel;
50 } 50 }
51 51
52 static void TestDeferredCanvasBitmapAccess(skiatest::Reporter* reporter) { 52 static void TestDeferredCanvasBitmapAccess(skiatest::Reporter* reporter) {
53 SkBitmap store; 53 SkBitmap store;
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 TestDeferredCanvasSurface(reporter, NULL); 831 TestDeferredCanvasSurface(reporter, NULL);
832 TestDeferredCanvasSetSurface(reporter, NULL); 832 TestDeferredCanvasSetSurface(reporter, NULL);
833 } 833 }
834 834
835 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 835 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
836 if (factory != NULL) { 836 if (factory != NULL) {
837 TestDeferredCanvasSurface(reporter, factory); 837 TestDeferredCanvasSurface(reporter, factory);
838 TestDeferredCanvasSetSurface(reporter, factory); 838 TestDeferredCanvasSetSurface(reporter, factory);
839 } 839 }
840 } 840 }
OLDNEW
« no previous file with comments | « tests/CachedDecodingPixelRefTest.cpp ('k') | tests/DrawBitmapRectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698