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

Unified Diff: gpu/demos/framework/pepper.cc

Issue 3531008: Integrated Pepper3D v2 with the accelerated compositor.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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: gpu/demos/framework/pepper.cc
===================================================================
--- gpu/demos/framework/pepper.cc (revision 65093)
+++ gpu/demos/framework/pepper.cc (working copy)
@@ -35,32 +35,31 @@
}
}
- virtual void ViewChanged(const pp::Rect& position, const pp::Rect& /*clip*/) {
- if (size_.IsEmpty() && !position.IsEmpty()) {
- size_ = position.size();
- demo_->InitWindowSize(size_.width(), size_.height());
+ virtual void DidChangeView(const pp::Rect& position,
+ const pp::Rect& /*clip*/) {
+ if (size_ == position.size())
+ return;
+
+ size_ = position.size();
+ demo_->InitWindowSize(size_.width(), size_.height());
+
+ if (graphics_.is_null()) {
graphics_ = pp::Graphics3D_Dev(*this, 0, NULL, NULL);
- if (!graphics_.is_null()) {
- graphics_.MakeCurrent();
- demo_->InitGL();
- pp::Graphics3D_Dev::ResetCurrent();
+ if (graphics_.is_null())
+ return;
- // TODO(neb): Remove this once the startup order bug (51842) is fixed.
- if (true)
- // if (demo_->IsAnimated())
- Animate(0);
- else
- Paint();
- }
+ if (!pp::Instance::BindGraphics(graphics_))
+ return;
+
+ graphics_.MakeCurrent();
+ demo_->InitGL();
+ pp::Graphics3D_Dev::ResetCurrent();
}
- }
- virtual void Graphics3DContextLost() {
- // TODO(neb): Replace this with the correct code once 53889 is fixed.
- Paint();
-// pp::Rect fake_position(size_);
-// size_ = pp::Size();
-// ViewChanged(fake_position, fake_position);
+ if (demo_->IsAnimated())
+ Animate(0);
+ else
+ Paint();
}
void Paint() {

Powered by Google App Engine
This is Rietveld 408576698