| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" |
| 14 #include "cc/output/compositor_frame_ack.h" | 15 #include "cc/output/compositor_frame_ack.h" |
| 15 #include "cc/quads/checkerboard_draw_quad.h" | 16 #include "cc/quads/checkerboard_draw_quad.h" |
| 16 #include "cc/quads/debug_border_draw_quad.h" | 17 #include "cc/quads/debug_border_draw_quad.h" |
| 17 #include "cc/quads/render_pass.h" | 18 #include "cc/quads/render_pass.h" |
| 18 #include "cc/quads/render_pass_draw_quad.h" | 19 #include "cc/quads/render_pass_draw_quad.h" |
| 19 #include "cc/quads/solid_color_draw_quad.h" | 20 #include "cc/quads/solid_color_draw_quad.h" |
| 20 #include "cc/quads/texture_draw_quad.h" | 21 #include "cc/quads/texture_draw_quad.h" |
| 21 #include "cc/quads/tile_draw_quad.h" | 22 #include "cc/quads/tile_draw_quad.h" |
| 22 #include "cc/quads/yuv_video_draw_quad.h" | 23 #include "cc/quads/yuv_video_draw_quad.h" |
| 23 #include "cc/resources/resource_provider.h" | 24 #include "cc/resources/resource_provider.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 WebGraphicsContext3D* context3d = resource_provider_->GraphicsContext3D(); | 62 WebGraphicsContext3D* context3d = resource_provider_->GraphicsContext3D(); |
| 62 | 63 |
| 63 if (!context3d) { | 64 if (!context3d) { |
| 64 // Software compositing. | 65 // Software compositing. |
| 65 return true; | 66 return true; |
| 66 } | 67 } |
| 67 | 68 |
| 68 if (!context3d->makeContextCurrent()) | 69 if (!context3d->makeContextCurrent()) |
| 69 return false; | 70 return false; |
| 70 | 71 |
| 71 context3d->pushGroupMarkerEXT("CompositorContext"); | 72 std::string unique_context_name = base::StringPrintf( |
| 73 "%s-%p", |
| 74 Settings().compositor_name.c_str(), |
| 75 context3d); |
| 76 context3d->pushGroupMarkerEXT(unique_context_name.c_str()); |
| 72 | 77 |
| 73 std::string extensions_string = | 78 std::string extensions_string = |
| 74 UTF16ToASCII(context3d->getString(GL_EXTENSIONS)); | 79 UTF16ToASCII(context3d->getString(GL_EXTENSIONS)); |
| 75 | 80 |
| 76 std::vector<std::string> extensions; | 81 std::vector<std::string> extensions; |
| 77 base::SplitString(extensions_string, ' ', &extensions); | 82 base::SplitString(extensions_string, ' ', &extensions); |
| 78 | 83 |
| 79 // TODO(danakj): We need non-GPU-specific paths for these things. This | 84 // TODO(danakj): We need non-GPU-specific paths for these things. This |
| 80 // renderer shouldn't need to use context3d extensions directly. | 85 // renderer shouldn't need to use context3d extensions directly. |
| 81 bool has_set_visibility = false; | 86 bool has_set_visibility = false; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 if (!context3d) | 181 if (!context3d) |
| 177 return false; | 182 return false; |
| 178 return context3d->getGraphicsResetStatusARB() != GL_NO_ERROR; | 183 return context3d->getGraphicsResetStatusARB() != GL_NO_ERROR; |
| 179 } | 184 } |
| 180 | 185 |
| 181 void DelegatingRenderer::SetVisible(bool visible) { | 186 void DelegatingRenderer::SetVisible(bool visible) { |
| 182 visible_ = visible; | 187 visible_ = visible; |
| 183 } | 188 } |
| 184 | 189 |
| 185 } // namespace cc | 190 } // namespace cc |
| OLD | NEW |