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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2646243002: Use IDCompositionSurface to implement DirectCompositionSurfaceWin. (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 1686
1687 // Wrapper for glLinkProgram 1687 // Wrapper for glLinkProgram
1688 void DoLinkProgram(GLuint program); 1688 void DoLinkProgram(GLuint program);
1689 1689
1690 // Wrapper for glOverlayPromotionHintCHROMIUIM 1690 // Wrapper for glOverlayPromotionHintCHROMIUIM
1691 void DoOverlayPromotionHintCHROMIUM(GLuint client_id, 1691 void DoOverlayPromotionHintCHROMIUM(GLuint client_id,
1692 GLboolean promotion_hint, 1692 GLboolean promotion_hint,
1693 GLint display_x, 1693 GLint display_x,
1694 GLint display_y); 1694 GLint display_y);
1695 1695
1696 // Wrapper for glSetDrawRectangleCHROMIUM
1697 void DoSetDrawRectangleCHROMIUM(GLint x, GLint y, GLint width, GLint height);
1698
1696 // Wrapper for glReadBuffer 1699 // Wrapper for glReadBuffer
1697 void DoReadBuffer(GLenum src); 1700 void DoReadBuffer(GLenum src);
1698 1701
1699 // Wrapper for glRenderbufferStorage. 1702 // Wrapper for glRenderbufferStorage.
1700 void DoRenderbufferStorage( 1703 void DoRenderbufferStorage(
1701 GLenum target, GLenum internalformat, GLsizei width, GLsizei height); 1704 GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1702 1705
1703 // Handler for glRenderbufferStorageMultisampleCHROMIUM. 1706 // Handler for glRenderbufferStorageMultisampleCHROMIUM.
1704 void DoRenderbufferStorageMultisampleCHROMIUM( 1707 void DoRenderbufferStorageMultisampleCHROMIUM(
1705 GLenum target, GLsizei samples, GLenum internalformat, 1708 GLenum target, GLsizei samples, GLenum internalformat,
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 int commands_to_process_; 2345 int commands_to_process_;
2343 2346
2344 bool has_robustness_extension_; 2347 bool has_robustness_extension_;
2345 error::ContextLostReason context_lost_reason_; 2348 error::ContextLostReason context_lost_reason_;
2346 bool context_was_lost_; 2349 bool context_was_lost_;
2347 bool reset_by_robustness_extension_; 2350 bool reset_by_robustness_extension_;
2348 bool supports_post_sub_buffer_; 2351 bool supports_post_sub_buffer_;
2349 bool supports_swap_buffers_with_bounds_; 2352 bool supports_swap_buffers_with_bounds_;
2350 bool supports_commit_overlay_planes_; 2353 bool supports_commit_overlay_planes_;
2351 bool supports_async_swap_; 2354 bool supports_async_swap_;
2355 bool supports_set_draw_rectangle_ = false;
2352 2356
2353 // These flags are used to override the state of the shared feature_info_ 2357 // These flags are used to override the state of the shared feature_info_
2354 // member. Because the same FeatureInfo instance may be shared among many 2358 // member. Because the same FeatureInfo instance may be shared among many
2355 // contexts, the assumptions on the availablity of extensions in WebGL 2359 // contexts, the assumptions on the availablity of extensions in WebGL
2356 // contexts may be broken. These flags override the shared state to preserve 2360 // contexts may be broken. These flags override the shared state to preserve
2357 // WebGL semantics. 2361 // WebGL semantics.
2358 bool derivatives_explicitly_enabled_; 2362 bool derivatives_explicitly_enabled_;
2359 bool frag_depth_explicitly_enabled_; 2363 bool frag_depth_explicitly_enabled_;
2360 bool draw_buffers_explicitly_enabled_; 2364 bool draw_buffers_explicitly_enabled_;
2361 bool shader_texture_lod_explicitly_enabled_; 2365 bool shader_texture_lod_explicitly_enabled_;
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3556 .disable_post_sub_buffers_for_onscreen_surfaces && 3560 .disable_post_sub_buffers_for_onscreen_surfaces &&
3557 !surface->IsOffscreen()) 3561 !surface->IsOffscreen())
3558 supports_post_sub_buffer_ = false; 3562 supports_post_sub_buffer_ = false;
3559 3563
3560 supports_swap_buffers_with_bounds_ = surface->SupportsSwapBuffersWithBounds(); 3564 supports_swap_buffers_with_bounds_ = surface->SupportsSwapBuffersWithBounds();
3561 3565
3562 supports_commit_overlay_planes_ = surface->SupportsCommitOverlayPlanes(); 3566 supports_commit_overlay_planes_ = surface->SupportsCommitOverlayPlanes();
3563 3567
3564 supports_async_swap_ = surface->SupportsAsyncSwap(); 3568 supports_async_swap_ = surface->SupportsAsyncSwap();
3565 3569
3570 supports_set_draw_rectangle_ =
3571 !offscreen && surface->SupportsSetDrawRectangle();
3572
3566 if (workarounds().reverse_point_sprite_coord_origin) { 3573 if (workarounds().reverse_point_sprite_coord_origin) {
3567 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); 3574 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
3568 } 3575 }
3569 3576
3570 if (workarounds().unbind_fbo_on_context_switch) { 3577 if (workarounds().unbind_fbo_on_context_switch) {
3571 context_->SetUnbindFboOnMakeCurrent(); 3578 context_->SetUnbindFboOnMakeCurrent();
3572 } 3579 }
3573 3580
3574 if (workarounds().gl_clear_broken) { 3581 if (workarounds().gl_clear_broken) {
3575 DCHECK(!clear_framebuffer_blit_.get()); 3582 DCHECK(!clear_framebuffer_blit_.get());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
3730 caps.iosurface = true; 3737 caps.iosurface = true;
3731 #endif 3738 #endif
3732 3739
3733 caps.post_sub_buffer = supports_post_sub_buffer_; 3740 caps.post_sub_buffer = supports_post_sub_buffer_;
3734 caps.swap_buffers_with_bounds = supports_swap_buffers_with_bounds_; 3741 caps.swap_buffers_with_bounds = supports_swap_buffers_with_bounds_;
3735 caps.commit_overlay_planes = supports_commit_overlay_planes_; 3742 caps.commit_overlay_planes = supports_commit_overlay_planes_;
3736 caps.surfaceless = surfaceless_; 3743 caps.surfaceless = surfaceless_;
3737 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); 3744 bool is_offscreen = !!offscreen_target_frame_buffer_.get();
3738 caps.flips_vertically = !is_offscreen && surface_->FlipsVertically(); 3745 caps.flips_vertically = !is_offscreen && surface_->FlipsVertically();
3739 caps.msaa_is_slow = workarounds().msaa_is_slow; 3746 caps.msaa_is_slow = workarounds().msaa_is_slow;
3747 caps.set_draw_rectangle = supports_set_draw_rectangle_;
3740 3748
3741 caps.blend_equation_advanced = 3749 caps.blend_equation_advanced =
3742 feature_info_->feature_flags().blend_equation_advanced; 3750 feature_info_->feature_flags().blend_equation_advanced;
3743 caps.blend_equation_advanced_coherent = 3751 caps.blend_equation_advanced_coherent =
3744 feature_info_->feature_flags().blend_equation_advanced_coherent; 3752 feature_info_->feature_flags().blend_equation_advanced_coherent;
3745 caps.texture_rg = feature_info_->feature_flags().ext_texture_rg; 3753 caps.texture_rg = feature_info_->feature_flags().ext_texture_rg;
3746 caps.texture_half_float_linear = 3754 caps.texture_half_float_linear =
3747 feature_info_->feature_flags().enable_texture_half_float_linear; 3755 feature_info_->feature_flags().enable_texture_half_float_linear;
3748 caps.color_buffer_half_float_rgba = 3756 caps.color_buffer_half_float_rgba =
3749 feature_info_->feature_flags().enable_color_buffer_float || 3757 feature_info_->feature_flags().enable_color_buffer_float ||
(...skipping 4932 matching lines...) Expand 10 before | Expand all | Expand 10 after
8682 GL_TEXTURE_EXTERNAL_OES, 0); 8690 GL_TEXTURE_EXTERNAL_OES, 0);
8683 if (!image) { 8691 if (!image) {
8684 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glOverlayPromotionHintCHROMIUM", 8692 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glOverlayPromotionHintCHROMIUM",
8685 "texture has no StreamTextureImage"); 8693 "texture has no StreamTextureImage");
8686 return; 8694 return;
8687 } 8695 }
8688 8696
8689 image->NotifyPromotionHint(promotion_hint != GL_FALSE, display_x, display_y); 8697 image->NotifyPromotionHint(promotion_hint != GL_FALSE, display_x, display_y);
8690 } 8698 }
8691 8699
8700 void GLES2DecoderImpl::DoSetDrawRectangleCHROMIUM(GLint x,
8701 GLint y,
8702 GLint width,
8703 GLint height) {
8704 Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
8705 if (framebuffer) {
8706 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
8707 "framebuffer must not be bound");
8708 return;
8709 }
8710 if (!supports_set_draw_rectangle_) {
8711 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
8712 "surface doesn't support SetDrawRectangle");
8713 return;
8714 }
8715 gfx::Rect rect(x, y, width, height);
8716 if (!surface_->SetDrawRectangle(rect)) {
8717 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
8718 "failed on surface");
8719 }
8720 }
8721
8692 void GLES2DecoderImpl::DoReadBuffer(GLenum src) { 8722 void GLES2DecoderImpl::DoReadBuffer(GLenum src) {
8693 Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER); 8723 Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER);
8694 if (framebuffer) { 8724 if (framebuffer) {
8695 if (src == GL_BACK) { 8725 if (src == GL_BACK) {
8696 LOCAL_SET_GL_ERROR( 8726 LOCAL_SET_GL_ERROR(
8697 GL_INVALID_ENUM, "glReadBuffer", 8727 GL_INVALID_ENUM, "glReadBuffer",
8698 "invalid src for a named framebuffer"); 8728 "invalid src for a named framebuffer");
8699 return; 8729 return;
8700 } 8730 }
8701 framebuffer->set_read_buffer(src); 8731 framebuffer->set_read_buffer(src);
(...skipping 10588 matching lines...) Expand 10 before | Expand all | Expand 10 after
19290 } 19320 }
19291 19321
19292 // Include the auto-generated part of this file. We split this because it means 19322 // Include the auto-generated part of this file. We split this because it means
19293 // we can easily edit the non-auto generated parts right here in this file 19323 // we can easily edit the non-auto generated parts right here in this file
19294 // instead of having to edit some template or the code generator. 19324 // instead of having to edit some template or the code generator.
19295 #include "base/macros.h" 19325 #include "base/macros.h"
19296 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19326 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19297 19327
19298 } // namespace gles2 19328 } // namespace gles2
19299 } // namespace gpu 19329 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698