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

Unified Diff: compositor/gles/opengles_visitor.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 third round of comments. Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: compositor/gles/opengles_visitor.cc
diff --git a/compositor/gles/opengles_visitor.cc b/compositor/gles/opengles_visitor.cc
index ffebe59417208d9344176c987e3bd7158de15ff2..c5c91d351369ca09dd047cdd234fca83c1811fe4 100644
--- a/compositor/gles/opengles_visitor.cc
+++ b/compositor/gles/opengles_visitor.cc
@@ -260,16 +260,30 @@ void OpenGlesDrawVisitor::VisitStage(RealCompositor::StageActor* actor) {
}
}
-void OpenGlesDrawVisitor::CreateTextureData(
- RealCompositor::TexturePixmapActor* actor) const {
- OpenGlesEglImageData image_data(gl_);
-
- if (!image_data.Bind(actor))
+void OpenGlesDrawVisitor::VisitContainer(
+ RealCompositor::ContainerActor* actor) {
+ if (!actor->IsVisible())
return;
- scoped_ptr<OpenGlesTextureData> texture(new OpenGlesTextureData(gl_));
- image_data.BindTexture(texture.get(), !actor->pixmap_is_opaque());
- actor->set_texture_data(texture.release());
+ LOG(INFO) << "Visit container: " << actor->name();
+
+ const float original_opacity = ancestor_opacity_;
+ ancestor_opacity_ *= actor->opacity();
+
+ // Back to front rendering
+ const RealCompositor::ActorVector children = actor->GetChildren();
+ for (RealCompositor::ActorVector::const_reverse_iterator i =
+ children.rbegin(); i != children.rend(); ++i) {
+ // TODO move this down into the Visit* functions
+ if ((*i)->is_opaque() && (*i)->opacity() * ancestor_opacity_ > 0.999)
+ gl_->Disable(GL_BLEND);
+ else
+ gl_->Enable(GL_BLEND);
+ (*i)->Accept(this);
+ }
+
+ // Reset opacity.
+ ancestor_opacity_ = original_opacity;
}
void OpenGlesDrawVisitor::VisitImage(RealCompositor::ImageActor* actor) {
@@ -443,6 +457,18 @@ void OpenGlesDrawVisitor::DrawQuad(RealCompositor::QuadActor* actor,
}
}
+void OpenGlesDrawVisitor::CreateTextureData(
+ RealCompositor::TexturePixmapActor* actor) const {
+ OpenGlesEglImageData image_data(gl_);
+
+ if (!image_data.Bind(actor))
+ return;
+
+ scoped_ptr<OpenGlesTextureData> texture(new OpenGlesTextureData(gl_));
+ image_data.BindTexture(texture.get(), !actor->pixmap_is_opaque());
+ actor->set_texture_data(texture.release());
+}
+
void OpenGlesDrawVisitor::PushScissorRect(const Rect& scissor) {
if (scissor_stack_.empty()) {
scissor_stack_.push_back(scissor);
@@ -471,32 +497,6 @@ void OpenGlesDrawVisitor::PopScissorRect() {
}
}
-void OpenGlesDrawVisitor::VisitContainer(
- RealCompositor::ContainerActor* actor) {
- if (!actor->IsVisible())
- return;
-
- LOG(INFO) << "Visit container: " << actor->name();
-
- const float original_opacity = ancestor_opacity_;
- ancestor_opacity_ *= actor->opacity();
-
- // Back to front rendering
- const RealCompositor::ActorVector children = actor->GetChildren();
- for (RealCompositor::ActorVector::const_reverse_iterator i =
- children.rbegin(); i != children.rend(); ++i) {
- // TODO move this down into the Visit* functions
- if ((*i)->is_opaque() && (*i)->opacity() * ancestor_opacity_ > 0.999)
- gl_->Disable(GL_BLEND);
- else
- gl_->Enable(GL_BLEND);
- (*i)->Accept(this);
- }
-
- // Reset opacity.
- ancestor_opacity_ = original_opacity;
-}
-
OpenGlesTextureData::OpenGlesTextureData(Gles2Interface* gl)
: gl_(gl) {}

Powered by Google App Engine
This is Rietveld 408576698