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

Unified Diff: cc/test/test_web_graphics_context_3d.h

Issue 46163003: Consolidate test contexts and remove unused ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: cc/test/test_web_graphics_context_3d.h
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index 796e34d7f86cdc7fabaa9f0175cd34f1f2d2e357..9502906a9426de41d94a9de3f860b513b3511d8e 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;
@@ -123,7 +124,11 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
virtual void setSwapBuffersCompleteCallbackCHROMIUM(
WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* callback);
+ virtual void enable(GLenum cap);
+ virtual void disable(GLenum cap);
+
virtual void prepareTexture();
+ virtual void postSubBufferCHROMIUM(int x, int y, int width, int height);
virtual void finish();
virtual void flush();
@@ -227,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();
@@ -301,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_;

Powered by Google App Engine
This is Rietveld 408576698