| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 public: | 122 public: |
| 123 static GLHelperHolder* Create(); | 123 static GLHelperHolder* Create(); |
| 124 ~GLHelperHolder() override; | 124 ~GLHelperHolder() override; |
| 125 | 125 |
| 126 void Initialize(); | 126 void Initialize(); |
| 127 | 127 |
| 128 // WebGraphicsContextLostCallback implementation. | 128 // WebGraphicsContextLostCallback implementation. |
| 129 void onContextLost() override; | 129 void onContextLost() override; |
| 130 | 130 |
| 131 GLHelper* GetGLHelper() { return gl_helper_.get(); } | 131 GLHelper* GetGLHelper() { return gl_helper_.get(); } |
| 132 bool IsLost() { return !context_.get() || context_->isContextLost(); } | 132 bool IsLost() { |
| 133 return !context_ || |
| 134 context_->GetGLInterface()->GetGraphicsResetStatusKHR() != |
| 135 GL_NO_ERROR; |
| 136 } |
| 133 | 137 |
| 134 private: | 138 private: |
| 135 GLHelperHolder(); | 139 GLHelperHolder(); |
| 136 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(); | 140 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(); |
| 137 | 141 |
| 138 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_; | 142 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_; |
| 139 scoped_ptr<GLHelper> gl_helper_; | 143 scoped_ptr<GLHelper> gl_helper_; |
| 140 | 144 |
| 141 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder); | 145 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder); |
| 142 }; | 146 }; |
| (...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 results->orientationAngle = display.RotationAsDegree(); | 2027 results->orientationAngle = display.RotationAsDegree(); |
| 2024 results->orientationType = | 2028 results->orientationType = |
| 2025 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2029 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2026 gfx::DeviceDisplayInfo info; | 2030 gfx::DeviceDisplayInfo info; |
| 2027 results->depth = info.GetBitsPerPixel(); | 2031 results->depth = info.GetBitsPerPixel(); |
| 2028 results->depthPerComponent = info.GetBitsPerComponent(); | 2032 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2029 results->isMonochrome = (results->depthPerComponent == 0); | 2033 results->isMonochrome = (results->depthPerComponent == 0); |
| 2030 } | 2034 } |
| 2031 | 2035 |
| 2032 } // namespace content | 2036 } // namespace content |
| OLD | NEW |