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

Side by Side Diff: tests/SurfaceTest.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/DrawPathTest.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkData.h" 9 #include "SkData.h"
10 #include "SkImageEncoder.h" 10 #include "SkImageEncoder.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 switch (imageType) { 95 switch (imageType) {
96 case kRasterCopy_ImageType: 96 case kRasterCopy_ImageType:
97 return SkImage::NewRasterCopy(info, addr, rowBytes); 97 return SkImage::NewRasterCopy(info, addr, rowBytes);
98 case kRasterData_ImageType: 98 case kRasterData_ImageType:
99 return SkImage::NewRasterData(info, data, rowBytes); 99 return SkImage::NewRasterData(info, data, rowBytes);
100 case kGpu_ImageType: 100 case kGpu_ImageType:
101 return NULL; // TODO 101 return NULL; // TODO
102 case kCodec_ImageType: { 102 case kCodec_ImageType: {
103 SkBitmap bitmap; 103 SkBitmap bitmap;
104 bitmap.installPixels(info, addr, rowBytes, NULL, NULL); 104 bitmap.installPixels(info, addr, rowBytes);
105 SkAutoTUnref<SkData> src( 105 SkAutoTUnref<SkData> src(
106 SkImageEncoder::EncodeData(bitmap, SkImageEncoder::kPNG_Type, 106 SkImageEncoder::EncodeData(bitmap, SkImageEncoder::kPNG_Type,
107 100)); 107 100));
108 return SkImage::NewEncodedData(src); 108 return SkImage::NewEncodedData(src);
109 } 109 }
110 } 110 }
111 SkASSERT(false); 111 SkASSERT(false);
112 return NULL; 112 return NULL;
113 } 113 }
114 114
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode); 438 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode);
439 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode); 439 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode);
440 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode); 440 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode);
441 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode); 441 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode);
442 TestGetTexture(reporter, kGpu_SurfaceType, context); 442 TestGetTexture(reporter, kGpu_SurfaceType, context);
443 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); 443 TestGetTexture(reporter, kGpuScratch_SurfaceType, context);
444 } 444 }
445 } 445 }
446 #endif 446 #endif
447 } 447 }
OLDNEW
« no previous file with comments | « tests/DrawPathTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698