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

Side by Side Diff: dm/DMSKPTask.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 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 | « dm/DMPDFTask.cpp ('k') | dm/DMUtil.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 "DMSKPTask.h" 1 #include "DMSKPTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
4 4
5 #include "SkCommandLineFlags.h" 5 #include "SkCommandLineFlags.h"
6 #include "SkPictureRecorder.h" 6 #include "SkPictureRecorder.h"
7 7
8 DEFINE_int32(skpMaxWidth, 1000, "Max SKPTask viewport width."); 8 DEFINE_int32(skpMaxWidth, 1000, "Max SKPTask viewport width.");
9 DEFINE_int32(skpMaxHeight, 1000, "Max SKPTask viewport height."); 9 DEFINE_int32(skpMaxHeight, 1000, "Max SKPTask viewport height.");
10 10
11 namespace DM { 11 namespace DM {
12 12
13 SKPTask::SKPTask(Reporter* r, TaskRunner* tr, const SkPicture* pic, SkString fil ename) 13 SKPTask::SKPTask(Reporter* r, TaskRunner* tr, const SkPicture* pic, SkString fil ename)
14 : CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {} 14 : CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {}
15 15
16 void SKPTask::draw() { 16 void SKPTask::draw() {
17 const int width = SkTMin(fPicture->width(), FLAGS_skpMaxWidth), 17 const int width = SkTMin(SkScalarCeilToInt(fPicture->cullRect().width()), FLAGS_skpMaxWidth),
18 height = SkTMin(fPicture->height(), FLAGS_skpMaxHeight); 18 height = SkTMin(SkScalarCeilToInt(fPicture->cullRect().height()), FLAGS_skpMaxHeight);
19 SkBitmap bitmap; 19 SkBitmap bitmap;
20 AllocatePixels(kN32_SkColorType, width, height, &bitmap); 20 AllocatePixels(kN32_SkColorType, width, height, &bitmap);
21 DrawPicture(*fPicture, &bitmap); 21 DrawPicture(*fPicture, &bitmap);
22 22
23 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); 23 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
24 } 24 }
25 25
26 } // namespace DM 26 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMPDFTask.cpp ('k') | dm/DMUtil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698