summaryrefslogtreecommitdiff
path: root/chromium/ui/aura/bench
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/aura/bench')
-rw-r--r--chromium/ui/aura/bench/DEPS1
-rw-r--r--chromium/ui/aura/bench/bench_main.cc38
2 files changed, 17 insertions, 22 deletions
diff --git a/chromium/ui/aura/bench/DEPS b/chromium/ui/aura/bench/DEPS
index 1fda55436bc..69deb976808 100644
--- a/chromium/ui/aura/bench/DEPS
+++ b/chromium/ui/aura/bench/DEPS
@@ -1,5 +1,4 @@
include_rules = [
- "+cc",
"+third_party/khronos",
"+third_party/WebKit/public/platform",
]
diff --git a/chromium/ui/aura/bench/bench_main.cc b/chromium/ui/aura/bench/bench_main.cc
index 17ed068e60b..aee7e79c83a 100644
--- a/chromium/ui/aura/bench/bench_main.cc
+++ b/chromium/ui/aura/bench/bench_main.cc
@@ -10,7 +10,6 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_split.h"
#include "base/time/time.h"
-#include "cc/output/context_provider.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkXfermode.h"
#include "ui/aura/client/default_capture_client.h"
@@ -182,7 +181,7 @@ class WebGLBench : public BenchCompositorObserver {
parent_(parent),
webgl_(ui::LAYER_TEXTURED),
compositor_(compositor),
- context_provider_(),
+ context_(),
texture_(),
fbo_(0),
do_draw_(true) {
@@ -208,26 +207,24 @@ class WebGLBench : public BenchCompositorObserver {
webgl_.SetBounds(bounds);
parent_->Add(&webgl_);
- context_provider_ = ui::ContextFactory::GetInstance()
- ->OffscreenContextProviderForMainThread();
- WebKit::WebGraphicsContext3D* context = context_provider_->Context3d();
- context->makeContextCurrent();
- texture_ = new WebGLTexture(context, bounds.size());
- fbo_ = context->createFramebuffer();
+ context_ = ui::ContextFactory::GetInstance()->CreateOffscreenContext();
+ context_->makeContextCurrent();
+ texture_ = new WebGLTexture(context_.get(), bounds.size());
+ fbo_ = context_->createFramebuffer();
compositor->AddObserver(this);
webgl_.SetExternalTexture(texture_.get());
- context->bindFramebuffer(GL_FRAMEBUFFER, fbo_);
- context->framebufferTexture2D(
+ context_->bindFramebuffer(GL_FRAMEBUFFER, fbo_);
+ context_->framebufferTexture2D(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, texture_->PrepareTexture(), 0);
- context->clearColor(0.f, 1.f, 0.f, 1.f);
- context->clear(GL_COLOR_BUFFER_BIT);
- context->flush();
+ context_->clearColor(0.f, 1.f, 0.f, 1.f);
+ context_->clear(GL_COLOR_BUFFER_BIT);
+ context_->flush();
}
virtual ~WebGLBench() {
- context_provider_->Context3d()->makeContextCurrent();
- context_provider_->Context3d()->deleteFramebuffer(fbo_);
+ context_->makeContextCurrent();
+ context_->deleteFramebuffer(fbo_);
webgl_.SetExternalTexture(NULL);
texture_ = NULL;
compositor_->RemoveObserver(this);
@@ -235,11 +232,10 @@ class WebGLBench : public BenchCompositorObserver {
virtual void Draw() OVERRIDE {
if (do_draw_) {
- WebKit::WebGraphicsContext3D* context = context_provider_->Context3d();
- context->makeContextCurrent();
- context->clearColor((frames() % kFrames)*1.0/kFrames, 1.f, 0.f, 1.f);
- context->clear(GL_COLOR_BUFFER_BIT);
- context->flush();
+ context_->makeContextCurrent();
+ context_->clearColor((frames() % kFrames)*1.0/kFrames, 1.f, 0.f, 1.f);
+ context_->clear(GL_COLOR_BUFFER_BIT);
+ context_->flush();
}
webgl_.SetExternalTexture(texture_.get());
webgl_.SchedulePaint(gfx::Rect(webgl_.bounds().size()));
@@ -250,7 +246,7 @@ class WebGLBench : public BenchCompositorObserver {
Layer* parent_;
Layer webgl_;
Compositor* compositor_;
- scoped_refptr<cc::ContextProvider> context_provider_;
+ scoped_ptr<WebGraphicsContext3D> context_;
scoped_refptr<WebGLTexture> texture_;
// The FBO that is used to render to the texture.