summaryrefslogtreecommitdiffstats
path: root/cc/test/test_web_graphics_context_3d.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 01:34:32 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 01:34:32 +0000
commit4bf4175bbb8958d4e05aaf410f3565baffa8984f (patch)
tree2004f399c230805472f6327e840baf72bc43f826 /cc/test/test_web_graphics_context_3d.h
parent49888f42b50096d80e936980075fe6e7968ce473 (diff)
downloadchromium_src-4bf4175bbb8958d4e05aaf410f3565baffa8984f.zip
chromium_src-4bf4175bbb8958d4e05aaf410f3565baffa8984f.tar.gz
chromium_src-4bf4175bbb8958d4e05aaf410f3565baffa8984f.tar.bz2
Consolidate test contexts and remove unused ones
This folds several simple TestWebGraphicsContext3D subclasses into the base class and removes several unused TestWebGraphicsContext3D subclasses. The goal is to remove dead code and make it easier to convert over to a GLES2Interface-based test base. R=danakj Review URL: https://codereview.chromium.org/46163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232876 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.h')
-rw-r--r--cc/test/test_web_graphics_context_3d.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 0d3c122..23d5fe9 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -20,6 +20,7 @@
#include "cc/test/ordered_texture_map.h"
#include "cc/test/test_texture.h"
#include "third_party/khronos/GLES2/gl2.h"
+#include "ui/gfx/rect.h"
namespace cc {
class TestContextSupport;
@@ -124,6 +125,7 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback);
virtual void prepareTexture();
+ virtual void postSubBufferCHROMIUM(int x, int y, int width, int height);
virtual void finish();
virtual void flush();
@@ -230,6 +232,24 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
test_support_ = test_support;
}
+ int width() const { return width_; }
+ int height() const { return height_; }
+ bool reshape_called() const { return reshape_called_; }
+ void clear_reshape_called() { reshape_called_ = false; }
+ float scale_factor() const { return scale_factor_; }
+
+ enum UpdateType {
+ NoUpdate = 0,
+ PrepareTexture,
+ PostSubBuffer
+ };
+
+ gfx::Rect update_rect() const { return update_rect_; }
+
+ UpdateType last_update_type() {
+ return last_update_type_;
+ }
+
protected:
struct TextureTargets {
TextureTargets();
@@ -304,12 +324,20 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
int times_map_buffer_chromium_succeeds_;
WebGraphicsContextLostCallback* context_lost_callback_;
WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* swap_buffers_callback_;
- base::hash_set<WebKit::WebGLId> used_textures_;
+ base::hash_set<unsigned> used_textures_;
+ unsigned next_program_id_;
+ base::hash_set<unsigned> program_set_;
+ unsigned next_shader_id_;
+ base::hash_set<unsigned> shader_set_;
std::vector<WebKit::WebGraphicsContext3D*> shared_contexts_;
int max_texture_size_;
+ bool reshape_called_;
int width_;
int height_;
+ float scale_factor_;
TestContextSupport* test_support_;
+ gfx::Rect update_rect_;
+ UpdateType last_update_type_;
unsigned bound_buffer_;
TextureTargets texture_targets_;