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

Side by Side Diff: tools/PictureRenderer.h

Issue 1151603005: Revert of Store context options on caps. (Closed) Base URL: https://skia.googlesource.com/skia.git@onecaps
Patch Set: Created 5 years, 7 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 | « tools/CopyTilesRenderer.cpp ('k') | tools/PictureRenderer.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 #ifndef PictureRenderer_DEFINED 8 #ifndef PictureRenderer_DEFINED
9 #define PictureRenderer_DEFINED 9 #define PictureRenderer_DEFINED
10 10
(...skipping 10 matching lines...) Expand all
21 #include "SkTDArray.h" 21 #include "SkTDArray.h"
22 #include "SkTypes.h" 22 #include "SkTypes.h"
23 23
24 #if SK_SUPPORT_GPU 24 #if SK_SUPPORT_GPU
25 #include "GrContextFactory.h" 25 #include "GrContextFactory.h"
26 #include "GrContext.h" 26 #include "GrContext.h"
27 #endif 27 #endif
28 28
29 #include "image_expectations.h" 29 #include "image_expectations.h"
30 30
31 struct GrContextOptions;
32 class SkBitmap; 31 class SkBitmap;
33 class SkCanvas; 32 class SkCanvas;
34 class SkGLContext; 33 class SkGLContext;
35 class SkThread; 34 class SkThread;
36 35
37 namespace sk_tools { 36 namespace sk_tools {
38 37
39 class TiledPictureRenderer; 38 class TiledPictureRenderer;
40 39
41 class PictureRenderer : public SkRefCnt { 40 class PictureRenderer : public SkRefCnt {
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 default: 385 default:
387 return NULL; 386 return NULL;
388 } 387 }
389 return fGrContextFactory.getGLContext(glContextType); 388 return fGrContextFactory.getGLContext(glContextType);
390 } 389 }
391 390
392 GrContext* getGrContext() { 391 GrContext* getGrContext() {
393 return fGrContext; 392 return fGrContext;
394 } 393 }
395 394
396 const GrContextOptions& getGrContextOptions() { 395 const GrContext::Options& getGrContextOptions() {
397 return fGrContextFactory.getGlobalOptions(); 396 return fGrContextFactory.getGlobalOptions();
398 } 397 }
399 #endif 398 #endif
400 399
401 SkCanvas* getCanvas() { 400 SkCanvas* getCanvas() {
402 return fCanvas; 401 return fCanvas;
403 } 402 }
404 403
405 const SkPicture* getPicture() { 404 const SkPicture* getPicture() {
406 return fPicture; 405 return fPicture;
407 } 406 }
408 407
409 #if SK_SUPPORT_GPU 408 #if SK_SUPPORT_GPU
410 explicit PictureRenderer(const GrContextOptions &opts) 409 explicit PictureRenderer(const GrContext::Options &opts)
411 #else 410 #else
412 PictureRenderer() 411 PictureRenderer()
413 #endif 412 #endif
414 : fJsonSummaryPtr(NULL) 413 : fJsonSummaryPtr(NULL)
415 , fDeviceType(kBitmap_DeviceType) 414 , fDeviceType(kBitmap_DeviceType)
416 , fEnableWrites(false) 415 , fEnableWrites(false)
417 , fBBoxHierarchyType(kNone_BBoxHierarchyType) 416 , fBBoxHierarchyType(kNone_BBoxHierarchyType)
418 , fScaleFactor(SK_Scalar1) 417 , fScaleFactor(SK_Scalar1)
419 #if SK_SUPPORT_GPU 418 #if SK_SUPPORT_GPU
420 , fGrContextFactory(opts) 419 , fGrContextFactory(opts)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 typedef SkRefCnt INHERITED; 491 typedef SkRefCnt INHERITED;
493 }; 492 };
494 493
495 /** 494 /**
496 * This class does not do any rendering, but its render function executes record ing, which we want 495 * This class does not do any rendering, but its render function executes record ing, which we want
497 * to time. 496 * to time.
498 */ 497 */
499 class RecordPictureRenderer : public PictureRenderer { 498 class RecordPictureRenderer : public PictureRenderer {
500 public: 499 public:
501 #if SK_SUPPORT_GPU 500 #if SK_SUPPORT_GPU
502 RecordPictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { } 501 RecordPictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
503 #endif 502 #endif
504 503
505 bool render(SkBitmap** out = NULL) override; 504 bool render(SkBitmap** out = NULL) override;
506 505
507 SkString getPerIterTimeFormat() override { return SkString("%.4f"); } 506 SkString getPerIterTimeFormat() override { return SkString("%.4f"); }
508 507
509 SkString getNormalTimeFormat() override { return SkString("%6.4f"); } 508 SkString getNormalTimeFormat() override { return SkString("%6.4f"); }
510 509
511 protected: 510 protected:
512 SkCanvas* setupCanvas(int width, int height) override; 511 SkCanvas* setupCanvas(int width, int height) override;
513 512
514 private: 513 private:
515 SkString getConfigNameInternal() override; 514 SkString getConfigNameInternal() override;
516 515
517 typedef PictureRenderer INHERITED; 516 typedef PictureRenderer INHERITED;
518 }; 517 };
519 518
520 class PipePictureRenderer : public PictureRenderer { 519 class PipePictureRenderer : public PictureRenderer {
521 public: 520 public:
522 #if SK_SUPPORT_GPU 521 #if SK_SUPPORT_GPU
523 PipePictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { } 522 PipePictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
524 #endif 523 #endif
525 524
526 bool render(SkBitmap** out = NULL) override; 525 bool render(SkBitmap** out = NULL) override;
527 526
528 private: 527 private:
529 SkString getConfigNameInternal() override; 528 SkString getConfigNameInternal() override;
530 529
531 typedef PictureRenderer INHERITED; 530 typedef PictureRenderer INHERITED;
532 }; 531 };
533 532
534 class SimplePictureRenderer : public PictureRenderer { 533 class SimplePictureRenderer : public PictureRenderer {
535 public: 534 public:
536 #if SK_SUPPORT_GPU 535 #if SK_SUPPORT_GPU
537 SimplePictureRenderer(const GrContextOptions &opts) : INHERITED(opts) { } 536 SimplePictureRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
538 #endif 537 #endif
539 538
540 virtual void init(const SkPicture* pict, 539 virtual void init(const SkPicture* pict,
541 const SkString* writePath, 540 const SkString* writePath,
542 const SkString* mismatchPath, 541 const SkString* mismatchPath,
543 const SkString* inputFilename, 542 const SkString* inputFilename,
544 bool useChecksumBasedFilenames, 543 bool useChecksumBasedFilenames,
545 bool useMultiPictureDraw) override; 544 bool useMultiPictureDraw) override;
546 545
547 bool render(SkBitmap** out = NULL) override; 546 bool render(SkBitmap** out = NULL) override;
548 547
549 private: 548 private:
550 SkString getConfigNameInternal() override; 549 SkString getConfigNameInternal() override;
551 550
552 typedef PictureRenderer INHERITED; 551 typedef PictureRenderer INHERITED;
553 }; 552 };
554 553
555 class TiledPictureRenderer : public PictureRenderer { 554 class TiledPictureRenderer : public PictureRenderer {
556 public: 555 public:
557 #if SK_SUPPORT_GPU 556 #if SK_SUPPORT_GPU
558 TiledPictureRenderer(const GrContextOptions &opts); 557 TiledPictureRenderer(const GrContext::Options &opts);
559 #else 558 #else
560 TiledPictureRenderer(); 559 TiledPictureRenderer();
561 #endif 560 #endif
562 561
563 virtual void init(const SkPicture* pict, 562 virtual void init(const SkPicture* pict,
564 const SkString* writePath, 563 const SkString* writePath,
565 const SkString* mismatchPath, 564 const SkString* mismatchPath,
566 const SkString* inputFilename, 565 const SkString* inputFilename,
567 bool useChecksumBasedFilenames, 566 bool useChecksumBasedFilenames,
568 bool useMultiPictureDraw) override; 567 bool useMultiPictureDraw) override;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 typedef PictureRenderer INHERITED; 682 typedef PictureRenderer INHERITED;
684 }; 683 };
685 684
686 /** 685 /**
687 * This class does not do any rendering, but its render function executes turnin g an SkPictureRecord 686 * This class does not do any rendering, but its render function executes turnin g an SkPictureRecord
688 * into an SkPicturePlayback, which we want to time. 687 * into an SkPicturePlayback, which we want to time.
689 */ 688 */
690 class PlaybackCreationRenderer : public PictureRenderer { 689 class PlaybackCreationRenderer : public PictureRenderer {
691 public: 690 public:
692 #if SK_SUPPORT_GPU 691 #if SK_SUPPORT_GPU
693 PlaybackCreationRenderer(const GrContextOptions &opts) : INHERITED(opts) { } 692 PlaybackCreationRenderer(const GrContext::Options &opts) : INHERITED(opts) { }
694 #endif 693 #endif
695 694
696 void setup() override; 695 void setup() override;
697 696
698 bool render(SkBitmap** out = NULL) override; 697 bool render(SkBitmap** out = NULL) override;
699 698
700 SkString getPerIterTimeFormat() override { return SkString("%.4f"); } 699 SkString getPerIterTimeFormat() override { return SkString("%.4f"); }
701 700
702 SkString getNormalTimeFormat() override { return SkString("%6.4f"); } 701 SkString getNormalTimeFormat() override { return SkString("%6.4f"); }
703 702
704 private: 703 private:
705 SkAutoTDelete<SkPictureRecorder> fRecorder; 704 SkAutoTDelete<SkPictureRecorder> fRecorder;
706 705
707 SkString getConfigNameInternal() override; 706 SkString getConfigNameInternal() override;
708 707
709 typedef PictureRenderer INHERITED; 708 typedef PictureRenderer INHERITED;
710 }; 709 };
711 710
712 #if SK_SUPPORT_GPU 711 #if SK_SUPPORT_GPU
713 extern PictureRenderer* CreateGatherPixelRefsRenderer(const GrContextOptions& op ts); 712 extern PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts);
714 #else 713 #else
715 extern PictureRenderer* CreateGatherPixelRefsRenderer(); 714 extern PictureRenderer* CreateGatherPixelRefsRenderer();
716 #endif 715 #endif
717 716
718 } 717 }
719 718
720 #endif // PictureRenderer_DEFINED 719 #endif // PictureRenderer_DEFINED
OLDNEW
« no previous file with comments | « tools/CopyTilesRenderer.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698