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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2646243002: Use IDCompositionSurface to implement DirectCompositionSurfaceWin. (Closed)
Patch Set: rebase Created 3 years, 10 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: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 67eab70d4c2b78f6cc40624311490d18bea8a6b8..aad78dd98f18495cd8b74ac2c10fa355d4cce9fa 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1693,6 +1693,9 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
GLint display_x,
GLint display_y);
+ // Wrapper for glSetDrawRectangleCHROMIUM
+ void DoSetDrawRectangleCHROMIUM(GLint x, GLint y, GLint width, GLint height);
+
// Wrapper for glReadBuffer
void DoReadBuffer(GLenum src);
@@ -2349,6 +2352,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
bool supports_swap_buffers_with_bounds_;
bool supports_commit_overlay_planes_;
bool supports_async_swap_;
+ bool supports_set_draw_rectangle_ = false;
// These flags are used to override the state of the shared feature_info_
// member. Because the same FeatureInfo instance may be shared among many
@@ -3563,6 +3567,9 @@ bool GLES2DecoderImpl::Initialize(
supports_async_swap_ = surface->SupportsAsyncSwap();
+ supports_set_draw_rectangle_ =
+ !offscreen && surface->SupportsSetDrawRectangle();
+
if (workarounds().reverse_point_sprite_coord_origin) {
glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
}
@@ -3737,6 +3744,7 @@ Capabilities GLES2DecoderImpl::GetCapabilities() {
bool is_offscreen = !!offscreen_target_frame_buffer_.get();
caps.flips_vertically = !is_offscreen && surface_->FlipsVertically();
caps.msaa_is_slow = workarounds().msaa_is_slow;
+ caps.set_draw_rectangle = supports_set_draw_rectangle_;
caps.blend_equation_advanced =
feature_info_->feature_flags().blend_equation_advanced;
@@ -8689,6 +8697,28 @@ void GLES2DecoderImpl::DoOverlayPromotionHintCHROMIUM(GLuint client_id,
image->NotifyPromotionHint(promotion_hint != GL_FALSE, display_x, display_y);
}
+void GLES2DecoderImpl::DoSetDrawRectangleCHROMIUM(GLint x,
+ GLint y,
+ GLint width,
+ GLint height) {
+ Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
+ if (framebuffer) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
+ "framebuffer must not be bound");
+ return;
+ }
+ if (!supports_set_draw_rectangle_) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
+ "surface doesn't support SetDrawRectangle");
+ return;
+ }
+ gfx::Rect rect(x, y, width, height);
+ if (!surface_->SetDrawRectangle(rect)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glSetDrawRectangleCHROMIUM",
+ "failed on surface");
+ }
+}
+
void GLES2DecoderImpl::DoReadBuffer(GLenum src) {
Framebuffer* framebuffer = GetFramebufferInfoForTarget(GL_READ_FRAMEBUFFER);
if (framebuffer) {
« 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