Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 | 8 |
| 9 namespace gpu { | 9 namespace gpu { |
| 10 namespace gles2 { | 10 namespace gles2 { |
| (...skipping 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2660 | 2660 |
| 2661 if (translated_source_length > 0) { | 2661 if (translated_source_length > 0) { |
| 2662 std::vector<char> buffer(translated_source_length, 0); | 2662 std::vector<char> buffer(translated_source_length, 0); |
| 2663 glGetTranslatedShaderSourceANGLE(service_id, translated_source_length, | 2663 glGetTranslatedShaderSourceANGLE(service_id, translated_source_length, |
| 2664 nullptr, buffer.data()); | 2664 nullptr, buffer.data()); |
| 2665 *source = std::string(buffer.data()); | 2665 *source = std::string(buffer.data()); |
| 2666 } | 2666 } |
| 2667 return error::kNoError; | 2667 return error::kNoError; |
| 2668 } | 2668 } |
| 2669 | 2669 |
| 2670 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffersWithDamageCHROMIUM( | 2670 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffersWithBoundsCHROMIUM( |
| 2671 GLint x, | 2671 GLsizei count, |
| 2672 GLint y, | 2672 const volatile GLint* rects) { |
| 2673 GLint width, | 2673 std::vector<gfx::Rect> bounds(count); |
| 2674 GLint height) { | 2674 for (GLsizei i = 0; i != count; ++i) { |
|
meacer
2017/02/02 21:42:33
Why not i < count?
halliwell
2017/02/03 20:17:00
Old habit :) Updated to <
| |
| 2675 gfx::SwapResult result = surface_->PostSubBuffer(x, y, width, height); | 2675 bounds[i] = gfx::Rect(rects[i * 4 + 0], rects[i * 4 + 1], rects[i * 4 + 2], |
| 2676 rects[i * 4 + 3]); | |
| 2677 } | |
| 2678 gfx::SwapResult result = surface_->SwapBuffersWithBounds(bounds); | |
| 2676 if (result == gfx::SwapResult::SWAP_FAILED) { | 2679 if (result == gfx::SwapResult::SWAP_FAILED) { |
| 2677 LOG(ERROR) << "Context lost because PostSubBuffer failed."; | 2680 LOG(ERROR) << "Context lost because SwapBuffersWithBounds failed."; |
| 2678 } | 2681 } |
| 2679 // TODO(geofflang): force the context loss? | 2682 // TODO(geofflang): force the context loss? |
| 2680 return error::kNoError; | 2683 return error::kNoError; |
| 2681 } | 2684 } |
| 2682 | 2685 |
| 2683 error::Error GLES2DecoderPassthroughImpl::DoPostSubBufferCHROMIUM( | 2686 error::Error GLES2DecoderPassthroughImpl::DoPostSubBufferCHROMIUM( |
| 2684 GLint x, | 2687 GLint x, |
| 2685 GLint y, | 2688 GLint y, |
| 2686 GLint width, | 2689 GLint width, |
| 2687 GLint height) { | 2690 GLint height) { |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3319 GLuint texture, | 3322 GLuint texture, |
| 3320 GLboolean promotion_hint, | 3323 GLboolean promotion_hint, |
| 3321 GLint display_x, | 3324 GLint display_x, |
| 3322 GLint display_y) { | 3325 GLint display_y) { |
| 3323 NOTIMPLEMENTED(); | 3326 NOTIMPLEMENTED(); |
| 3324 return error::kNoError; | 3327 return error::kNoError; |
| 3325 } | 3328 } |
| 3326 | 3329 |
| 3327 } // namespace gles2 | 3330 } // namespace gles2 |
| 3328 } // namespace gpu | 3331 } // namespace gpu |
| OLD | NEW |