| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
| 9 #include "SamplePipeControllers.h" | 9 #include "SamplePipeControllers.h" |
| 10 #include "SkCommonFlags.h" | 10 #include "SkCommonFlags.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 , fUseDFText(dfText) | 341 , fUseDFText(dfText) |
| 342 , fThreaded(threaded) {} | 342 , fThreaded(threaded) {} |
| 343 | 343 |
| 344 int GPUSink::enclave() const { | 344 int GPUSink::enclave() const { |
| 345 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave; | 345 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave; |
| 346 } | 346 } |
| 347 | 347 |
| 348 void PreAbandonGpuContextErrorHandler(SkError, void*) {} | 348 void PreAbandonGpuContextErrorHandler(SkError, void*) {} |
| 349 | 349 |
| 350 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
nst { | 350 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
nst { |
| 351 const SkString foo = src.name(); |
| 352 const char* bar = foo.c_str(); |
| 353 SkDebugf("%s\n", bar); |
| 351 GrContextFactory factory; | 354 GrContextFactory factory; |
| 352 const SkISize size = src.size(); | 355 const SkISize size = src.size(); |
| 353 const SkImageInfo info = | 356 const SkImageInfo info = |
| 354 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul
_SkAlphaType); | 357 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul
_SkAlphaType); |
| 355 SkAutoTUnref<SkSurface> surface( | 358 SkAutoTUnref<SkSurface> surface( |
| 356 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f
UseDFText)); | 359 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f
UseDFText)); |
| 357 if (!surface) { | 360 if (!surface) { |
| 358 return "Could not create a surface."; | 361 return "Could not create a surface."; |
| 359 } | 362 } |
| 360 if (FLAGS_preAbandonGpuContext) { | 363 if (FLAGS_preAbandonGpuContext) { |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 canvas->drawPicture(pic); | 723 canvas->drawPicture(pic); |
| 721 return ""; | 724 return ""; |
| 722 } | 725 } |
| 723 SkISize size() const override { return fSrc.size(); } | 726 SkISize size() const override { return fSrc.size(); } |
| 724 Name name() const override { sk_throw(); return ""; } // No one should
be calling this. | 727 Name name() const override { sk_throw(); return ""; } // No one should
be calling this. |
| 725 } proxy(src); | 728 } proxy(src); |
| 726 return fSink->draw(proxy, bitmap, stream, log); | 729 return fSink->draw(proxy, bitmap, stream, log); |
| 727 } | 730 } |
| 728 | 731 |
| 729 } // namespace DM | 732 } // namespace DM |
| OLD | NEW |