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

Side by Side Diff: core/cross/renderer.h

Issue 199066: Make more stuff private in renderer (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | core/cross/renderer.cc » ('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 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 virtual void SetViewportInPixels(int left, 622 virtual void SetViewportInPixels(int left,
623 int top, 623 int top,
624 int width, 624 int width,
625 int height, 625 int height,
626 float min_z, 626 float min_z,
627 float max_z) = 0; 627 float max_z) = 0;
628 628
629 // Sets the client's size. Derived classes must call this on Init and Resize. 629 // Sets the client's size. Derived classes must call this on Init and Resize.
630 void SetClientSize(int width, int height); 630 void SetClientSize(int width, int height);
631 631
632 // The current render surfaces. NULL = no surface. 632 // Calls any registered lost resources callback.
633 const RenderSurface* current_render_surface_; 633 void CallLostResourcesCallback() const {
634 const RenderDepthStencilSurface* current_depth_surface_; 634 lost_resources_callback_manager_.Run();
635 bool current_render_surface_is_back_buffer_; 635 }
636
637 Sampler::Ref error_sampler_; // sampler used when one is missing.
638 Texture::Ref error_texture_; // texture used when one is missing.
639 Texture::Ref fallback_error_texture_; // texture used when error_texture is
640 // null.
641 ParamObject::Ref error_object_; // holds params used for missing textures.
642 ParamSampler::Ref error_param_sampler_; // A Param for the error sampler.
643
644 // Map of State Handlers.
645 StateHandlerMap state_handler_map_;
646
647 // Stack of state params
648 ParamVectorArray state_param_stacks_;
649
650 // Stack of state objects.
651 StateArray state_stack_;
652
653 // State object holding the default state settings.
654 State::Ref default_state_;
655
656 // A State object holding the settings required to be able to clear the
657 // back buffer.
658 State::Ref clear_back_buffer_state_;
659
660 // Lost Resources Callbacks.
661 LostResourcesCallbackManager lost_resources_callback_manager_;
662 636
663 int dest_x_offset() const { 637 int dest_x_offset() const {
664 return dest_x_offset_; 638 return dest_x_offset_;
665 } 639 }
666 640
667 int dest_y_offset() const { 641 int dest_y_offset() const {
668 return dest_y_offset_; 642 return dest_y_offset_;
669 } 643 }
670 644
671 Features* features() const { 645 Features* features() const {
(...skipping 14 matching lines...) Expand all
686 void ClearBackBufferIfNotCleared() { 660 void ClearBackBufferIfNotCleared() {
687 if (!back_buffer_cleared_ && current_render_surface_is_back_buffer_) { 661 if (!back_buffer_cleared_ && current_render_surface_is_back_buffer_) {
688 ClearBackBuffer(); 662 ClearBackBuffer();
689 } 663 }
690 } 664 }
691 665
692 ServiceLocator* service_locator_; 666 ServiceLocator* service_locator_;
693 ServiceImplementation<Renderer> service_; 667 ServiceImplementation<Renderer> service_;
694 ServiceDependency<Features> features_; 668 ServiceDependency<Features> features_;
695 669
670 // The current render surfaces. NULL = no surface.
671 const RenderSurface* current_render_surface_;
672 const RenderDepthStencilSurface* current_depth_surface_;
673 bool current_render_surface_is_back_buffer_;
674
675 Sampler::Ref error_sampler_; // sampler used when one is missing.
676 Texture::Ref error_texture_; // texture used when one is missing.
677 Texture::Ref fallback_error_texture_; // texture used when error_texture is
678 // null.
679 ParamObject::Ref error_object_; // holds params used for missing textures.
680 ParamSampler::Ref error_param_sampler_; // A Param for the error sampler.
681
682 // Map of State Handlers.
683 StateHandlerMap state_handler_map_;
684
685 // Stack of state params
686 ParamVectorArray state_param_stacks_;
687
688 // Stack of state objects.
689 StateArray state_stack_;
690
691 // State object holding the default state settings.
692 State::Ref default_state_;
693
694 // A State object holding the settings required to be able to clear the
695 // back buffer.
696 State::Ref clear_back_buffer_state_;
697
698 // Lost Resources Callbacks.
699 LostResourcesCallbackManager lost_resources_callback_manager_;
700
696 // Current viewport setting. 701 // Current viewport setting.
697 Float4 viewport_; 702 Float4 viewport_;
698 703
699 // Current depth range. 704 // Current depth range.
700 Float2 depth_range_; 705 Float2 depth_range_;
701 706
702 // Current write mask. 707 // Current write mask.
703 int write_mask_; 708 int write_mask_;
704 709
705 int render_frame_count_; // count of times we've rendered frame. 710 int render_frame_count_; // count of times we've rendered frame.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 747
743 // Whether the backbuffer has been cleared this frame. 748 // Whether the backbuffer has been cleared this frame.
744 bool back_buffer_cleared_; 749 bool back_buffer_cleared_;
745 750
746 DISALLOW_COPY_AND_ASSIGN(Renderer); 751 DISALLOW_COPY_AND_ASSIGN(Renderer);
747 }; 752 };
748 753
749 } // namespace o3d 754 } // namespace o3d
750 755
751 #endif // O3D_CORE_CROSS_RENDERER_H_ 756 #endif // O3D_CORE_CROSS_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | core/cross/renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698