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

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

Issue 10007034: aura: Change shared context to be offscreen for arm (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79f2c0493f0de5a4c09bbe2ec0ddc71bf41400db..adf0519ff20625930df637e3a224e00c117f0045 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -472,6 +472,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
// Overridden from GLES2Decoder.
virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
+ bool offscreen,
const gfx::Size& size,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
@@ -1947,6 +1948,7 @@ GLES2DecoderImpl::~GLES2DecoderImpl() {
bool GLES2DecoderImpl::Initialize(
const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
+ bool offscreen,
const gfx::Size& size,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
@@ -2069,7 +2071,7 @@ bool GLES2DecoderImpl::Initialize(
glGetIntegerv(GL_STENCIL_BITS, &v);
back_buffer_has_stencil_ = attrib_parser.stencil_size_ != 0 && v > 0;
- if (surface_->IsOffscreen()) {
+ if (offscreen) {
if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 &&
(context_->HasExtension("GL_EXT_framebuffer_multisample") ||
context_->HasExtension("GL_ANGLE_framebuffer_multisample"))) {
@@ -7710,32 +7712,30 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers(
ScopedResolvedFrameBufferBinder binder(this, true, false);
return error::kNoError;
} else {
- if (surface_->IsOffscreen()) {
- ScopedFrameBufferBinder binder(this,
- offscreen_target_frame_buffer_->id());
-
- if (offscreen_target_buffer_preserved_) {
- // Copy the target frame buffer to the saved offscreen texture.
- offscreen_saved_color_texture_->Copy(
- offscreen_saved_color_texture_->size(),
- offscreen_saved_color_format_);
- } else {
- // Flip the textures in the parent context via the texture manager.
- if (!!offscreen_saved_color_texture_info_.get())
- offscreen_saved_color_texture_info_->
- SetServiceId(offscreen_target_color_texture_->id());
-
- offscreen_saved_color_texture_.swap(offscreen_target_color_texture_);
- offscreen_target_frame_buffer_->AttachRenderTexture(
- offscreen_target_color_texture_.get());
- }
-
- // Ensure the side effects of the copy are visible to the parent
- // context. There is no need to do this for ANGLE because it uses a
- // single D3D device for all contexts.
- if (!IsAngle())
- glFlush();
+ ScopedFrameBufferBinder binder(this,
+ offscreen_target_frame_buffer_->id());
+
+ if (offscreen_target_buffer_preserved_) {
+ // Copy the target frame buffer to the saved offscreen texture.
+ offscreen_saved_color_texture_->Copy(
+ offscreen_saved_color_texture_->size(),
+ offscreen_saved_color_format_);
+ } else {
+ // Flip the textures in the parent context via the texture manager.
+ if (!!offscreen_saved_color_texture_info_.get())
+ offscreen_saved_color_texture_info_->
+ SetServiceId(offscreen_target_color_texture_->id());
+
+ offscreen_saved_color_texture_.swap(offscreen_target_color_texture_);
+ offscreen_target_frame_buffer_->AttachRenderTexture(
+ offscreen_target_color_texture_.get());
}
+
+ // Ensure the side effects of the copy are visible to the parent
+ // context. There is no need to do this for ANGLE because it uses a
+ // single D3D device for all contexts.
+ if (!IsAngle())
+ glFlush();
return error::kNoError;
}
} else {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698