summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-15 19:15:07 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-15 19:15:07 +0000
commitd0ae42e25411518364942eeaef32badf1bbd087e (patch)
tree3d1628048e3b21ae49279fa6a9af29ffb3f48c56 /cc
parentfa3416f9fbff598a69bd91f457a36471dfb9de57 (diff)
downloadchromium_src-d0ae42e25411518364942eeaef32badf1bbd087e.zip
chromium_src-d0ae42e25411518364942eeaef32badf1bbd087e.tar.gz
chromium_src-d0ae42e25411518364942eeaef32badf1bbd087e.tar.bz2
Remove remaining blink/WebKit refs from cc
This gets rid of the remaining blink references from cc: *) We don't use ActiveInfo in any production code, so we can remove the test fakes that use them *) The lost context callback is only used between TestContextProvider and TestWGC3D, so it can be routed directly using the base callback system instead of a function pointer type from blink BUG=181120 Review URL: https://codereview.chromium.org/135053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/output/gl_renderer_unittest.cc14
-rw-r--r--cc/resources/raster_worker_pool.cc1
-rw-r--r--cc/test/fake_web_graphics_context_3d.cc20
-rw-r--r--cc/test/fake_web_graphics_context_3d.h14
-rw-r--r--cc/test/test_context_provider.cc24
-rw-r--r--cc/test/test_context_provider.h3
-rw-r--r--cc/test/test_web_graphics_context_3d.cc12
-rw-r--r--cc/test/test_web_graphics_context_3d.h12
-rw-r--r--cc/trees/layer_tree_host_unittest_delegated.cc1
9 files changed, 13 insertions, 88 deletions
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index d9caad8..f7bb3bd 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -396,20 +396,6 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D {
public:
ForbidSynchronousCallContext() {}
- virtual bool getActiveAttrib(GLuint program,
- GLuint index,
- blink::WebGraphicsContext3D::ActiveInfo& info)
- OVERRIDE {
- ADD_FAILURE();
- return false;
- }
- virtual bool getActiveUniform(GLuint program,
- GLuint index,
- blink::WebGraphicsContext3D::ActiveInfo& info)
- OVERRIDE {
- ADD_FAILURE();
- return false;
- }
virtual void getAttachedShaders(GLuint program,
GLsizei max_count,
GLsizei* count,
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index d6f0507..fd0aacc 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -16,7 +16,6 @@
#include "third_party/skia/include/core/SkPixelRef.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/SkGpuDevice.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
namespace cc {
diff --git a/cc/test/fake_web_graphics_context_3d.cc b/cc/test/fake_web_graphics_context_3d.cc
index 6029fd4..efd0209 100644
--- a/cc/test/fake_web_graphics_context_3d.cc
+++ b/cc/test/fake_web_graphics_context_3d.cc
@@ -7,8 +7,6 @@
#include "base/logging.h"
#include "third_party/khronos/GLES2/gl2.h"
-using blink::WebGraphicsContext3D;
-
namespace cc {
FakeWebGraphicsContext3D::FakeWebGraphicsContext3D() {}
@@ -57,20 +55,6 @@ GLenum FakeWebGraphicsContext3D::checkFramebufferStatus(
return GL_FRAMEBUFFER_COMPLETE;
}
-bool FakeWebGraphicsContext3D::getActiveAttrib(
- GLuint program,
- GLuint index,
- WebGraphicsContext3D::ActiveInfo&) {
- return false;
-}
-
-bool FakeWebGraphicsContext3D::getActiveUniform(
- GLuint program,
- GLuint index,
- WebGraphicsContext3D::ActiveInfo&) {
- return false;
-}
-
GLint FakeWebGraphicsContext3D::getAttribLocation(
GLuint program,
const GLchar* name) {
@@ -312,10 +296,6 @@ void FakeWebGraphicsContext3D::getQueryObjectuivEXT(
GLuint* params) {
}
-void FakeWebGraphicsContext3D::setContextLostCallback(
- WebGraphicsContext3D::WebGraphicsContextLostCallback* callback) {
-}
-
void FakeWebGraphicsContext3D::loseContextCHROMIUM(GLenum current,
GLenum other) {
}
diff --git a/cc/test/fake_web_graphics_context_3d.h b/cc/test/fake_web_graphics_context_3d.h
index 0a8f101..3f60610 100644
--- a/cc/test/fake_web_graphics_context_3d.h
+++ b/cc/test/fake_web_graphics_context_3d.h
@@ -7,12 +7,12 @@
#include <string>
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "base/macros.h"
#include "third_party/khronos/GLES2/gl2.h"
namespace cc {
-// WebGraphicsContext3D base class for use in unit tests.
+// Base class for use in unit tests.
// All operations are no-ops (returning 0 if necessary).
class FakeWebGraphicsContext3D {
public:
@@ -214,13 +214,6 @@ class FakeWebGraphicsContext3D {
virtual void frontFace(GLenum mode) {}
virtual void generateMipmap(GLenum target) {}
- virtual bool getActiveAttrib(
- GLuint program,
- GLuint index, blink::WebGraphicsContext3D::ActiveInfo&);
- virtual bool getActiveUniform(
- GLuint program,
- GLuint index,
- blink::WebGraphicsContext3D::ActiveInfo&);
virtual void getAttachedShaders(
GLuint program,
GLsizei max_count,
@@ -573,9 +566,6 @@ class FakeWebGraphicsContext3D {
GLenum pname,
GLuint* params);
- virtual void setContextLostCallback(
- blink::WebGraphicsContext3D::WebGraphicsContextLostCallback* callback);
-
virtual void loseContextCHROMIUM(GLenum current,
GLenum other);
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index dda6e81..9e95d28 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -15,26 +15,6 @@
namespace cc {
-class TestContextProvider::LostContextCallbackProxy
- : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback {
- public:
- explicit LostContextCallbackProxy(TestContextProvider* provider)
- : provider_(provider) {
- provider_->context3d_->setContextLostCallback(this);
- }
-
- virtual ~LostContextCallbackProxy() {
- provider_->context3d_->setContextLostCallback(NULL);
- }
-
- virtual void onContextLost() {
- provider_->OnLostContext();
- }
-
- private:
- TestContextProvider* provider_;
-};
-
// static
scoped_refptr<TestContextProvider> TestContextProvider::Create() {
return Create(TestWebGraphicsContext3D::Create().Pass());
@@ -80,7 +60,9 @@ bool TestContextProvider::BindToCurrentThread() {
}
bound_ = true;
- lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
+ context3d_->set_context_lost_callback(
+ base::Bind(&TestContextProvider::OnLostContext,
+ base::Unretained(this)));
return true;
}
diff --git a/cc/test/test_context_provider.h b/cc/test/test_context_provider.h
index 4290725..2728d25 100644
--- a/cc/test/test_context_provider.h
+++ b/cc/test/test_context_provider.h
@@ -79,9 +79,6 @@ class TestContextProvider : public ContextProvider {
LostContextCallback lost_context_callback_;
MemoryPolicyChangedCallback memory_policy_changed_callback_;
- class LostContextCallbackProxy;
- scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
-
base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(TestContextProvider);
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index 2b17cdd..3631812 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -16,8 +16,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/khronos/GLES2/gl2ext.h"
-using blink::WebGraphicsContext3D;
-
namespace cc {
static const GLuint kFramebufferId = 1;
@@ -59,7 +57,6 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D()
context_lost_(false),
times_map_image_chromium_succeeds_(-1),
times_map_buffer_chromium_succeeds_(-1),
- context_lost_callback_(NULL),
next_program_id_(1000),
next_shader_id_(2000),
max_texture_size_(2048),
@@ -396,18 +393,13 @@ void TestWebGraphicsContext3D::genMailboxCHROMIUM(GLbyte* mailbox) {
}
}
-void TestWebGraphicsContext3D::setContextLostCallback(
- blink::WebGraphicsContext3D::WebGraphicsContextLostCallback* callback) {
- context_lost_callback_ = callback;
-}
-
void TestWebGraphicsContext3D::loseContextCHROMIUM(GLenum current,
GLenum other) {
if (context_lost_)
return;
context_lost_ = true;
- if (context_lost_callback_)
- context_lost_callback_->onContextLost();
+ if (!context_lost_callback_.is_null())
+ context_lost_callback_.Run();
for (size_t i = 0; i < shared_contexts_.size(); ++i)
shared_contexts_[i]->loseContextCHROMIUM(current, other);
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 81a43b5..2b15976 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/containers/scoped_ptr_hash_map.h"
@@ -31,6 +32,10 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
virtual ~TestWebGraphicsContext3D();
+ void set_context_lost_callback(const base::Closure& callback) {
+ context_lost_callback_ = callback;
+ }
+
virtual void reshapeWithScaleFactor(int width,
int height,
float scale_factor);
@@ -137,10 +142,6 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
virtual void consumeTextureCHROMIUM(GLenum target,
const GLbyte* mailbox) { }
- virtual void setContextLostCallback(
- blink::WebGraphicsContext3D::WebGraphicsContextLostCallback* callback)
- OVERRIDE;
-
virtual void loseContextCHROMIUM(GLenum current,
GLenum other) OVERRIDE;
@@ -346,8 +347,7 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
bool context_lost_;
int times_map_image_chromium_succeeds_;
int times_map_buffer_chromium_succeeds_;
- blink::WebGraphicsContext3D::WebGraphicsContextLostCallback*
- context_lost_callback_;
+ base::Closure context_lost_callback_;
base::hash_set<unsigned> used_textures_;
unsigned next_program_id_;
base::hash_set<unsigned> program_set_;
diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc
index 5a33fdc..5ca3bdd 100644
--- a/cc/trees/layer_tree_host_unittest_delegated.cc
+++ b/cc/trees/layer_tree_host_unittest_delegated.cc
@@ -28,7 +28,6 @@
#include "cc/test/layer_tree_test.h"
#include "cc/trees/layer_tree_impl.h"
#include "gpu/GLES2/gl2extchromium.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
namespace cc {
namespace {