OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 gfx::Size OutputSurface::SurfaceSize() const { | 129 gfx::Size OutputSurface::SurfaceSize() const { |
130 return surface_size_; | 130 return surface_size_; |
131 } | 131 } |
132 | 132 |
133 void OutputSurface::BindFramebuffer() { | 133 void OutputSurface::BindFramebuffer() { |
134 DCHECK(context3d_); | 134 DCHECK(context3d_); |
135 context3d_->bindFramebuffer(GL_FRAMEBUFFER, 0); | 135 context3d_->bindFramebuffer(GL_FRAMEBUFFER, 0); |
136 } | 136 } |
137 | 137 |
138 void OutputSurface::SwapBuffers(const ui::LatencyInfo& latency_info) { | 138 void OutputSurface::SwapBuffers(const ui::LatencyInfo& latency_info) { |
139 DCHECK(context3d_); | 139 if (context3d_) { |
140 // Note that currently this has the same effect as SwapBuffers; we should | 140 // Note that currently this has the same effect as SwapBuffers; we should |
141 // consider exposing a different entry point on WebGraphicsContext3D. | 141 // consider exposing a different entry point on WebGraphicsContext3D. |
142 context3d_->prepareTexture(); | 142 context3d_->prepareTexture(); |
| 143 } |
143 } | 144 } |
144 | 145 |
145 void OutputSurface::PostSubBuffer(gfx::Rect rect, | 146 void OutputSurface::PostSubBuffer(gfx::Rect rect, |
146 const ui::LatencyInfo& latency_info) { | 147 const ui::LatencyInfo& latency_info) { |
147 DCHECK(context3d_); | 148 DCHECK(context3d_); |
148 context3d_->postSubBufferCHROMIUM( | 149 context3d_->postSubBufferCHROMIUM( |
149 rect.x(), rect.y(), rect.width(), rect.height()); | 150 rect.x(), rect.y(), rect.width(), rect.height()); |
150 } | 151 } |
151 | 152 |
152 } // namespace cc | 153 } // namespace cc |
OLD | NEW |