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

Side by Side Diff: tools/CopyTilesRenderer.cpp

Issue 171723007: add new copyTo version to SkBitmap, which takes SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « tests/GpuBitmapCopyTest.cpp ('k') | tools/skdiff_utils.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 "picture_utils.h" 8 #include "picture_utils.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Similar to writeAppendNumber in PictureRenderer.c pp, but just encodes 63 // Similar to writeAppendNumber in PictureRenderer.c pp, but just encodes
64 // a bitmap directly. 64 // a bitmap directly.
65 SkString pathWithNumber(*path); 65 SkString pathWithNumber(*path);
66 pathWithNumber.appendf("%i.png", i++); 66 pathWithNumber.appendf("%i.png", i++);
67 SkBitmap copy; 67 SkBitmap copy;
68 #if SK_SUPPORT_GPU 68 #if SK_SUPPORT_GPU
69 if (isUsingGpuDevice()) { 69 if (isUsingGpuDevice()) {
70 dst.pixelRef()->readPixels(&copy, &subset); 70 dst.pixelRef()->readPixels(&copy, &subset);
71 } else { 71 } else {
72 #endif 72 #endif
73 dst.copyTo(&copy, dst.config()); 73 dst.copyTo(&copy);
74 #if SK_SUPPORT_GPU 74 #if SK_SUPPORT_GPU
75 } 75 }
76 #endif 76 #endif
77 success &= SkImageEncoder::EncodeFile(pathWithNumber .c_str(), copy, 77 success &= SkImageEncoder::EncodeFile(pathWithNumber .c_str(), copy,
78 SkImageEncoder ::kPNG_Type, 100); 78 SkImageEncoder ::kPNG_Type, 100);
79 } 79 }
80 } 80 }
81 } 81 }
82 } 82 }
83 } 83 }
84 return success; 84 return success;
85 } 85 }
86 86
87 SkString CopyTilesRenderer::getConfigNameInternal() { 87 SkString CopyTilesRenderer::getConfigNameInternal() {
88 return SkString("copy_tiles"); 88 return SkString("copy_tiles");
89 } 89 }
90 } 90 }
OLDNEW
« no previous file with comments | « tests/GpuBitmapCopyTest.cpp ('k') | tools/skdiff_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698