diff options
author | 2013-10-16 18:21:03 +0000 | |
---|---|---|
committer | 2013-10-16 18:21:03 +0000 | |
commit | 846872f75bf3bfa86dbc3d4d672118959193487a (patch) | |
tree | 7bc1e3d0ac5760e2c259c3d5dd591498856811a9 /dm | |
parent | c7a40fad0b4c243087ad1adb14ebc2184d42cac0 (diff) |
Fix DM build failures:
- forgot tool_main;
- skip building where skia_gpu is false;
- lots of scalar -> int warnings;
- stray return on a void method;
- stifle warning about a uint32_t cast to bool
BUG=
R=bungeman@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/26468005
git-svn-id: http://skia.googlecode.com/svn/trunk@11821 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 10 | ||||
-rw-r--r-- | dm/DMCpuTask.cpp | 2 | ||||
-rw-r--r-- | dm/DMGpuTask.cpp | 12 | ||||
-rw-r--r-- | dm/DMReplayTask.cpp | 6 |
4 files changed, 21 insertions, 9 deletions
@@ -129,8 +129,8 @@ public: } }; - -int main(int argc, char** argv) { +int tool_main(int argc, char** argv); +int tool_main(int argc, char** argv) { SkGraphics::Init(); SkCommandLineFlags::Parse(argc, argv); @@ -164,3 +164,9 @@ int main(int argc, char** argv) { return reporter.failed() > 0; } + +#if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) +int main(int argc, char** argv) { + return tool_main(argc, argv); +} +#endif diff --git a/dm/DMCpuTask.cpp b/dm/DMCpuTask.cpp index 5534ba4a43..544f73c4c1 100644 --- a/dm/DMCpuTask.cpp +++ b/dm/DMCpuTask.cpp @@ -24,7 +24,7 @@ CpuTask::CpuTask(const char* name, void CpuTask::draw() { SkBitmap bitmap; - bitmap.setConfig(fConfig, fGM->width(), fGM->height()); + bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height())); bitmap.allocPixels(); bitmap.eraseColor(0x00000000); SkCanvas canvas(bitmap); diff --git a/dm/DMGpuTask.cpp b/dm/DMGpuTask.cpp index 9205cb996b..6cf69ffc1c 100644 --- a/dm/DMGpuTask.cpp +++ b/dm/DMGpuTask.cpp @@ -30,7 +30,7 @@ static void* new_gr_context_factory() { } static void delete_gr_context_factory(void* factory) { - return SkDELETE((GrContextFactory*) factory); + SkDELETE((GrContextFactory*) factory); } static GrContextFactory* get_gr_factory() { @@ -40,7 +40,11 @@ static GrContextFactory* get_gr_factory() { void GpuTask::draw() { GrContext* gr = get_gr_factory()->get(fContextType); // Will be owned by device. - SkGpuDevice device(gr, fConfig, fGM->width(), fGM->height(), fSampleCount); + SkGpuDevice device(gr, + fConfig, + SkScalarCeilToInt(fGM->width()), + SkScalarCeilToInt(fGM->height()), + fSampleCount); SkCanvas canvas(&device); canvas.concat(fGM->getInitialTransform()); @@ -48,7 +52,7 @@ void GpuTask::draw() { canvas.flush(); SkBitmap bitmap; - bitmap.setConfig(fConfig, fGM->width(), fGM->height()); + bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height())); canvas.readPixels(&bitmap, 0, 0); // We offload checksum comparison to the main CPU threadpool. @@ -57,7 +61,7 @@ void GpuTask::draw() { } bool GpuTask::shouldSkip() const { - return fGM->getFlags() & skiagm::GM::kSkipGPU_Flag; + return SkToBool(fGM->getFlags() & skiagm::GM::kSkipGPU_Flag); } } // namespace DM diff --git a/dm/DMReplayTask.cpp b/dm/DMReplayTask.cpp index bc94f73cb1..7e183f6cbd 100644 --- a/dm/DMReplayTask.cpp +++ b/dm/DMReplayTask.cpp @@ -19,7 +19,9 @@ ReplayTask::ReplayTask(const char* suffix, void ReplayTask::draw() { SkPicture picture; - SkCanvas* canvas = picture.beginRecording(fGM->width(), fGM->height(), 0 /*flags*/); + SkCanvas* canvas = picture.beginRecording(SkScalarCeilToInt(fGM->width()), + SkScalarCeilToInt(fGM->height()), + 0 /*flags*/); canvas->concat(fGM->getInitialTransform()); fGM->draw(canvas); @@ -28,7 +30,7 @@ void ReplayTask::draw() { picture.endRecording(); SkBitmap bitmap; - bitmap.setConfig(fConfig, fGM->width(), fGM->height()); + bitmap.setConfig(fConfig, SkScalarCeilToInt(fGM->width()), SkScalarCeilToInt(fGM->height())); bitmap.allocPixels(); bitmap.eraseColor(0x00000000); |