OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 context_->deleteTexture(texture_id); | 2214 context_->deleteTexture(texture_id); |
2215 request->SendEmptyResult(); | 2215 request->SendEmptyResult(); |
2216 return; | 2216 return; |
2217 } | 2217 } |
2218 | 2218 |
2219 GLC(context_, context_->bindTexture(GL_TEXTURE_2D, texture_id)); | 2219 GLC(context_, context_->bindTexture(GL_TEXTURE_2D, texture_id)); |
2220 GLC(context_, context_->produceTextureCHROMIUM( | 2220 GLC(context_, context_->produceTextureCHROMIUM( |
2221 GL_TEXTURE_2D, mailbox.name)); | 2221 GL_TEXTURE_2D, mailbox.name)); |
2222 GLC(context_, context_->bindTexture(GL_TEXTURE_2D, 0)); | 2222 GLC(context_, context_->bindTexture(GL_TEXTURE_2D, 0)); |
2223 sync_point = context_->insertSyncPoint(); | 2223 sync_point = context_->insertSyncPoint(); |
2224 scoped_ptr<TextureMailbox> texture_mailbox = make_scoped_ptr( | 2224 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, sync_point); |
2225 new TextureMailbox(mailbox, | 2225 scoped_ptr<SingleReleaseCallback> release_callback = |
2226 texture_mailbox_deleter_->GetReleaseCallback( | 2226 texture_mailbox_deleter_->GetReleaseCallback( |
2227 output_surface_->context_provider(), texture_id), | 2227 output_surface_->context_provider(), texture_id); |
2228 GL_TEXTURE_2D, | 2228 request->SendTextureResult(window_rect.size(), |
2229 sync_point)); | 2229 texture_mailbox, |
2230 request->SendTextureResult(window_rect.size(), texture_mailbox.Pass()); | 2230 release_callback.Pass()); |
2231 return; | 2231 return; |
2232 } | 2232 } |
2233 | 2233 |
2234 DCHECK(request->force_bitmap_result()); | 2234 DCHECK(request->force_bitmap_result()); |
2235 | 2235 |
2236 scoped_ptr<SkBitmap> bitmap(new SkBitmap); | 2236 scoped_ptr<SkBitmap> bitmap(new SkBitmap); |
2237 bitmap->setConfig(SkBitmap::kARGB_8888_Config, | 2237 bitmap->setConfig(SkBitmap::kARGB_8888_Config, |
2238 window_rect.width(), | 2238 window_rect.width(), |
2239 window_rect.height()); | 2239 window_rect.height()); |
2240 bitmap->allocPixels(); | 2240 bitmap->allocPixels(); |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas | 3119 // The Skia GPU backend requires a stencil buffer. See ReinitializeGrCanvas |
3120 // implementation. | 3120 // implementation. |
3121 return gr_context_ && context_->getContextAttributes().stencil; | 3121 return gr_context_ && context_->getContextAttributes().stencil; |
3122 } | 3122 } |
3123 | 3123 |
3124 bool GLRenderer::IsContextLost() { | 3124 bool GLRenderer::IsContextLost() { |
3125 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); | 3125 return (context_->getGraphicsResetStatusARB() != GL_NO_ERROR); |
3126 } | 3126 } |
3127 | 3127 |
3128 } // namespace cc | 3128 } // namespace cc |
OLD | NEW |