| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index b82228a43d4c5936c294e5cbeb14c9c892de9658..9340f290c4997a541ac6491826659dff56cce90a 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -38,6 +38,7 @@
|
| #include "cc/trees/single_thread_proxy.h"
|
| #include "gpu/GLES2/gl2extchromium.h"
|
| #include "gpu/command_buffer/client/context_support.h"
|
| +#include "gpu/command_buffer/client/gles2_interface.h"
|
| #include "gpu/command_buffer/common/gpu_memory_allocation.h"
|
| #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
|
| #include "third_party/khronos/GLES2/gl2.h"
|
| @@ -170,6 +171,7 @@ GLRenderer::GLRenderer(RendererClient* client,
|
| offscreen_framebuffer_id_(0),
|
| shared_geometry_quad_(gfx::RectF(-0.5f, -0.5f, 1.0f, 1.0f)),
|
| context_(output_surface->context_provider()->Context3d()),
|
| + gl_(output_surface->context_provider()->ContextGL()),
|
| context_support_(output_surface->context_provider()->ContextSupport()),
|
| texture_mailbox_deleter_(texture_mailbox_deleter),
|
| is_backbuffer_discarded_(false),
|
| @@ -959,7 +961,7 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
|
| }
|
|
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->shared_quad_state->visible_content_rect.bottom_right());
|
|
|
| int shader_quad_location = -1;
|
| @@ -1465,7 +1467,7 @@ void GLRenderer::DrawContentQuad(const DrawingFrame* frame,
|
| float vertex_tex_scale_y = tile_rect.height() / clamp_geom_rect.height();
|
|
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->texture_size);
|
|
|
| gfx::Transform device_transform =
|
| @@ -1608,7 +1610,7 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
|
| SetBlendEnabled(quad->ShouldDrawWithBlending());
|
|
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->shared_quad_state->visible_content_rect.bottom_right());
|
|
|
| bool use_alpha_plane = quad->a_plane_resource_id != 0;
|
| @@ -1721,7 +1723,7 @@ void GLRenderer::DrawStreamVideoQuad(const DrawingFrame* frame,
|
| DCHECK(capabilities_.using_egl_image);
|
|
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->shared_quad_state->visible_content_rect.bottom_right());
|
|
|
| const VideoStreamTextureProgram* program =
|
| @@ -1903,7 +1905,7 @@ void GLRenderer::FlushTextureQuadCache() {
|
| void GLRenderer::EnqueueTextureQuad(const DrawingFrame* frame,
|
| const TextureDrawQuad* quad) {
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->shared_quad_state->visible_content_rect.bottom_right());
|
|
|
| // Choose the correct texture program binding
|
| @@ -1968,7 +1970,7 @@ void GLRenderer::DrawIOSurfaceQuad(const DrawingFrame* frame,
|
| SetBlendEnabled(quad->ShouldDrawWithBlending());
|
|
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| quad->shared_quad_state->visible_content_rect.bottom_right());
|
|
|
| TexTransformTextureProgramBinding binding;
|
| @@ -2100,7 +2102,7 @@ void GLRenderer::SetBlendEnabled(bool enabled) {
|
| void GLRenderer::SetUseProgram(unsigned program) {
|
| if (program == program_shadow_)
|
| return;
|
| - GLC(context_, context_->useProgram(program));
|
| + gl_->UseProgram(program);
|
| program_shadow_ = program;
|
| }
|
|
|
| @@ -2124,7 +2126,7 @@ void GLRenderer::CopyTextureToFramebuffer(const DrawingFrame* frame,
|
| const gfx::Transform& draw_matrix,
|
| bool flip_vertically) {
|
| TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired(
|
| - context_, &highp_threshold_cache_, highp_threshold_min_,
|
| + gl_, &highp_threshold_cache_, highp_threshold_min_,
|
| rect.bottom_right());
|
|
|
| const RenderPassProgram* program = GetRenderPassProgram(tex_coord_precision);
|
| @@ -3019,39 +3021,39 @@ void GLRenderer::CleanupSharedObjects() {
|
|
|
| for (int i = 0; i < NumTexCoordPrecisions; ++i) {
|
| for (int j = 0; j < NumSamplerTypes; ++j) {
|
| - tile_program_[i][j].Cleanup(context_);
|
| - tile_program_opaque_[i][j].Cleanup(context_);
|
| - tile_program_swizzle_[i][j].Cleanup(context_);
|
| - tile_program_swizzle_opaque_[i][j].Cleanup(context_);
|
| - tile_program_aa_[i][j].Cleanup(context_);
|
| - tile_program_swizzle_aa_[i][j].Cleanup(context_);
|
| + tile_program_[i][j].Cleanup(gl_);
|
| + tile_program_opaque_[i][j].Cleanup(gl_);
|
| + tile_program_swizzle_[i][j].Cleanup(gl_);
|
| + tile_program_swizzle_opaque_[i][j].Cleanup(gl_);
|
| + tile_program_aa_[i][j].Cleanup(gl_);
|
| + tile_program_swizzle_aa_[i][j].Cleanup(gl_);
|
| }
|
|
|
| - render_pass_mask_program_[i].Cleanup(context_);
|
| - render_pass_program_[i].Cleanup(context_);
|
| - render_pass_mask_program_aa_[i].Cleanup(context_);
|
| - render_pass_program_aa_[i].Cleanup(context_);
|
| - render_pass_color_matrix_program_[i].Cleanup(context_);
|
| - render_pass_mask_color_matrix_program_aa_[i].Cleanup(context_);
|
| - render_pass_color_matrix_program_aa_[i].Cleanup(context_);
|
| - render_pass_mask_color_matrix_program_[i].Cleanup(context_);
|
| + render_pass_mask_program_[i].Cleanup(gl_);
|
| + render_pass_program_[i].Cleanup(gl_);
|
| + render_pass_mask_program_aa_[i].Cleanup(gl_);
|
| + render_pass_program_aa_[i].Cleanup(gl_);
|
| + render_pass_color_matrix_program_[i].Cleanup(gl_);
|
| + render_pass_mask_color_matrix_program_aa_[i].Cleanup(gl_);
|
| + render_pass_color_matrix_program_aa_[i].Cleanup(gl_);
|
| + render_pass_mask_color_matrix_program_[i].Cleanup(gl_);
|
|
|
| - texture_program_[i].Cleanup(context_);
|
| - nonpremultiplied_texture_program_[i].Cleanup(context_);
|
| - texture_background_program_[i].Cleanup(context_);
|
| - nonpremultiplied_texture_background_program_[i].Cleanup(context_);
|
| - texture_io_surface_program_[i].Cleanup(context_);
|
| + texture_program_[i].Cleanup(gl_);
|
| + nonpremultiplied_texture_program_[i].Cleanup(gl_);
|
| + texture_background_program_[i].Cleanup(gl_);
|
| + nonpremultiplied_texture_background_program_[i].Cleanup(gl_);
|
| + texture_io_surface_program_[i].Cleanup(gl_);
|
|
|
| - video_yuv_program_[i].Cleanup(context_);
|
| - video_yuva_program_[i].Cleanup(context_);
|
| - video_stream_texture_program_[i].Cleanup(context_);
|
| + video_yuv_program_[i].Cleanup(gl_);
|
| + video_yuva_program_[i].Cleanup(gl_);
|
| + video_stream_texture_program_[i].Cleanup(gl_);
|
| }
|
|
|
| - tile_checkerboard_program_.Cleanup(context_);
|
| + tile_checkerboard_program_.Cleanup(gl_);
|
|
|
| - debug_border_program_.Cleanup(context_);
|
| - solid_color_program_.Cleanup(context_);
|
| - solid_color_program_aa_.Cleanup(context_);
|
| + debug_border_program_.Cleanup(gl_);
|
| + solid_color_program_.Cleanup(gl_);
|
| + solid_color_program_aa_.Cleanup(gl_);
|
|
|
| if (offscreen_framebuffer_id_)
|
| GLC(context_, context_->deleteFramebuffer(offscreen_framebuffer_id_));
|
|
|