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

Side by Side Diff: dm/DMWriteTask.cpp

Issue 301283003: Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add guard for android 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 | Annotate | Revision Log
« no previous file with comments | « dm/DMGpuGMTask.cpp ('k') | gm/gmmain.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 #include "DMWriteTask.h" 1 #include "DMWriteTask.h"
2 2
3 #include "DMUtil.h" 3 #include "DMUtil.h"
4 #include "SkColorPriv.h" 4 #include "SkColorPriv.h"
5 #include "SkCommandLineFlags.h" 5 #include "SkCommandLineFlags.h"
6 #include "SkImageEncoder.h" 6 #include "SkImageEncoder.h"
7 #include "SkMallocPixelRef.h" 7 #include "SkMallocPixelRef.h"
8 #include "SkStream.h" 8 #include "SkStream.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 const size_t offset = data->size() - bitmapBytes; 92 const size_t offset = data->size() - bitmapBytes;
93 SkAutoTUnref<SkData> subset( 93 SkAutoTUnref<SkData> subset(
94 SkData::NewSubset(data, offset, bitmapBytes)); 94 SkData::NewSubset(data, offset, bitmapBytes));
95 SkAutoTUnref<SkPixelRef> pixels( 95 SkAutoTUnref<SkPixelRef> pixels(
96 SkMallocPixelRef::NewWithData( 96 SkMallocPixelRef::NewWithData(
97 info, rowBytes, NULL/*ctable*/, subset)); 97 info, rowBytes, NULL/*ctable*/, subset));
98 SkASSERT(pixels); 98 SkASSERT(pixels);
99 99
100 bitmap->setConfig(info, rowBytes); 100 bitmap->setInfo(info, rowBytes);
101 bitmap->setPixelRef(pixels); 101 bitmap->setPixelRef(pixels);
102 return true; 102 return true;
103 } 103 }
104 }; 104 };
105 105
106 } // namespace 106 } // namespace
107 107
108 void WriteTask::draw() { 108 void WriteTask::draw() {
109 SkString dir(FLAGS_writePath[0]); 109 SkString dir(FLAGS_writePath[0]);
110 this->makeDirOrFail(dir); 110 this->makeDirOrFail(dir);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 const SkString path = path_to_expected_image(fRoot, task); 160 const SkString path = path_to_expected_image(fRoot, task);
161 SkBitmap expected; 161 SkBitmap expected;
162 if (!PngAndRaw::Decode(path.c_str(), bitmap.info(), &expected)) { 162 if (!PngAndRaw::Decode(path.c_str(), bitmap.info(), &expected)) {
163 return false; 163 return false;
164 } 164 }
165 165
166 return BitmapsEqual(expected, bitmap); 166 return BitmapsEqual(expected, bitmap);
167 } 167 }
168 168
169 } // namespace DM 169 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuGMTask.cpp ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698