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

Side by Side Diff: compositor/real_compositor.cc

Issue 6793005: Add the xrender backend to the window manager. (Closed) Base URL: ssh://gitrw.chromium.org:9222/window_manager.git@master
Patch Set: Address fourth round of comments. Created 9 years, 8 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 | « compositor/real_compositor.h ('k') | compositor/texture_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "window_manager/compositor/compositor.h" 5 #include "window_manager/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
11 #include <gflags/gflags.h> 11 #include <gflags/gflags.h>
12 12
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "window_manager/callback.h" 15 #include "window_manager/callback.h"
16 #if defined(COMPOSITOR_OPENGL) 16 #if defined(COMPOSITOR_OPENGL)
17 #include "window_manager/compositor/gl/opengl_visitor.h" 17 #include "window_manager/compositor/gl/opengl_visitor.h"
18 #elif defined(COMPOSITOR_OPENGLES) 18 #elif defined(COMPOSITOR_OPENGLES)
19 #include "window_manager/compositor/gles/opengles_visitor.h" 19 #include "window_manager/compositor/gles/opengles_visitor.h"
20 #elif defined(COMPOSITOR_XRENDER)
21 #include "window_manager/compositor/xrender/xrender_visitor.h"
20 #endif 22 #endif
21 #include "window_manager/compositor/layer_visitor.h" 23 #include "window_manager/compositor/layer_visitor.h"
22 #include "window_manager/event_loop.h" 24 #include "window_manager/event_loop.h"
23 #include "window_manager/image_container.h" 25 #include "window_manager/image_container.h"
24 #include "window_manager/profiler.h" 26 #include "window_manager/profiler.h"
25 #include "window_manager/util.h" 27 #include "window_manager/util.h"
26 #include "window_manager/x11/x_connection.h" 28 #include "window_manager/x11/x_connection.h"
27 29
28 DEFINE_bool(compositor_display_debug_needle, false, 30 DEFINE_bool(compositor_display_debug_needle, false,
29 "Specify this to turn on a debugging aid for seeing when " 31 "Specify this to turn on a debugging aid for seeing when "
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 601 }
600 602
601 RealCompositor::Actor* RealCompositor::ImageActor::Clone() { 603 RealCompositor::Actor* RealCompositor::ImageActor::Clone() {
602 ImageActor* new_instance = new ImageActor(compositor()); 604 ImageActor* new_instance = new ImageActor(compositor());
603 QuadActor::CloneImpl(new_instance); 605 QuadActor::CloneImpl(new_instance);
604 return static_cast<Actor*>(new_instance); 606 return static_cast<Actor*>(new_instance);
605 } 607 }
606 608
607 void RealCompositor::ImageActor::SetImageData( 609 void RealCompositor::ImageActor::SetImageData(
608 const ImageContainer& image_container) { 610 const ImageContainer& image_container) {
609 compositor()->draw_visitor()->BindImage(&image_container, this); 611 compositor()->draw_visitor()->BindImage(image_container, this);
610 SetSizeInternal(image_container.width(), image_container.height()); 612 SetSizeInternal(image_container.width(), image_container.height());
611 SetDirty(); 613 SetDirty();
612 } 614 }
613 615
614 616
615 RealCompositor::TexturePixmapActor::TexturePixmapActor( 617 RealCompositor::TexturePixmapActor::TexturePixmapActor(
616 RealCompositor* compositor) 618 RealCompositor* compositor)
617 : RealCompositor::QuadActor(compositor), 619 : RealCompositor::QuadActor(compositor),
618 pixmap_(0), 620 pixmap_(0),
619 pixmap_is_opaque_(false) { 621 pixmap_is_opaque_(false) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 0, width(), height(), 0, 699 0, width(), height(), 0,
698 -kProjectedDepthMin, -kProjectedDepthMax); 700 -kProjectedDepthMin, -kProjectedDepthMax);
699 } 701 }
700 702
701 bool RealCompositor::StageActor::using_passthrough_projection() const { 703 bool RealCompositor::StageActor::using_passthrough_projection() const {
702 return true; 704 return true;
703 } 705 }
704 706
705 707
706 RealCompositor::RealCompositor(EventLoop* event_loop, 708 RealCompositor::RealCompositor(EventLoop* event_loop,
707 XConnection* xconn, 709 XConnection* xconn
708 #if defined(COMPOSITOR_OPENGL) 710 #if defined(COMPOSITOR_OPENGL)
709 GLInterface* gl_interface 711 ,GLInterface* gl_interface
710 #elif defined(COMPOSITOR_OPENGLES) 712 #elif defined(COMPOSITOR_OPENGLES)
711 Gles2Interface* gl_interface 713 ,Gles2Interface* gl_interface
712 #endif 714 #endif
713 ) 715 )
714 : event_loop_(event_loop), 716 : event_loop_(event_loop),
715 x_conn_(xconn), 717 x_conn_(xconn),
716 dirty_(true), 718 dirty_(true),
717 partially_dirty_(false), 719 partially_dirty_(false),
718 num_animations_(0), 720 num_animations_(0),
719 actor_count_(0), 721 actor_count_(0),
720 draw_timeout_id_(-1), 722 draw_timeout_id_(-1),
721 draw_timeout_enabled_(false), 723 draw_timeout_enabled_(false),
(...skipping 14 matching lines...) Expand all
736 new RealCompositor::StageActor(this, 738 new RealCompositor::StageActor(this,
737 window, 739 window,
738 geometry.bounds.width, 740 geometry.bounds.width,
739 geometry.bounds.height)); 741 geometry.bounds.height));
740 742
741 draw_visitor_.reset( 743 draw_visitor_.reset(
742 #if defined(COMPOSITOR_OPENGL) 744 #if defined(COMPOSITOR_OPENGL)
743 new OpenGlDrawVisitor(gl_interface, this, default_stage_.get()) 745 new OpenGlDrawVisitor(gl_interface, this, default_stage_.get())
744 #elif defined(COMPOSITOR_OPENGLES) 746 #elif defined(COMPOSITOR_OPENGLES)
745 new OpenGlesDrawVisitor(gl_interface, this, default_stage_.get()) 747 new OpenGlesDrawVisitor(gl_interface, this, default_stage_.get())
748 #elif defined(COMPOSITOR_XRENDER)
749 new XRenderDrawVisitor(this, default_stage_.get())
746 #endif 750 #endif
747 ); 751 );
748 752
749 #if defined(COMPOSITOR_OPENGL) 753 #if defined(COMPOSITOR_OPENGL)
750 if (!gl_interface->HasTextureFromPixmapExtension()) 754 if (!gl_interface->HasTextureFromPixmapExtension())
751 texture_pixmap_actor_uses_fast_path_ = false; 755 texture_pixmap_actor_uses_fast_path_ = false;
752 #endif 756 #endif
753 757
754 draw_timeout_id_ = event_loop_->AddTimeout( 758 draw_timeout_id_ = event_loop_->AddTimeout(
755 NewPermanentCallback(this, &RealCompositor::Draw), 0, 759 NewPermanentCallback(this, &RealCompositor::Draw), 0,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 } 928 }
925 929
926 void RealCompositor::DisableDrawTimeout() { 930 void RealCompositor::DisableDrawTimeout() {
927 if (draw_timeout_enabled_) { 931 if (draw_timeout_enabled_) {
928 event_loop_->SuspendTimeout(draw_timeout_id_); 932 event_loop_->SuspendTimeout(draw_timeout_id_);
929 draw_timeout_enabled_ = false; 933 draw_timeout_enabled_ = false;
930 } 934 }
931 } 935 }
932 936
933 } // namespace window_manager 937 } // namespace window_manager
OLDNEW
« no previous file with comments | « compositor/real_compositor.h ('k') | compositor/texture_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698