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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 public: | 121 public: |
122 static GLHelperHolder* Create(); | 122 static GLHelperHolder* Create(); |
123 ~GLHelperHolder() override; | 123 ~GLHelperHolder() override; |
124 | 124 |
125 void Initialize(); | 125 void Initialize(); |
126 | 126 |
127 // WebGraphicsContextLostCallback implementation. | 127 // WebGraphicsContextLostCallback implementation. |
128 void onContextLost() override; | 128 void onContextLost() override; |
129 | 129 |
130 GLHelper* GetGLHelper() { return gl_helper_.get(); } | 130 GLHelper* GetGLHelper() { return gl_helper_.get(); } |
131 bool IsLost() { return !context_.get() || context_->isContextLost(); } | 131 bool IsLost() { |
| 132 return !context_ || |
| 133 context_->GetGLInterface()->GetGraphicsResetStatusKHR() != |
| 134 GL_NO_ERROR; |
| 135 } |
132 | 136 |
133 private: | 137 private: |
134 GLHelperHolder(); | 138 GLHelperHolder(); |
135 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(); | 139 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(); |
136 | 140 |
137 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_; | 141 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_; |
138 scoped_ptr<GLHelper> gl_helper_; | 142 scoped_ptr<GLHelper> gl_helper_; |
139 | 143 |
140 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder); | 144 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder); |
141 }; | 145 }; |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2021 results->orientationAngle = display.RotationAsDegree(); | 2025 results->orientationAngle = display.RotationAsDegree(); |
2022 results->orientationType = | 2026 results->orientationType = |
2023 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2027 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2024 gfx::DeviceDisplayInfo info; | 2028 gfx::DeviceDisplayInfo info; |
2025 results->depth = info.GetBitsPerPixel(); | 2029 results->depth = info.GetBitsPerPixel(); |
2026 results->depthPerComponent = info.GetBitsPerComponent(); | 2030 results->depthPerComponent = info.GetBitsPerComponent(); |
2027 results->isMonochrome = (results->depthPerComponent == 0); | 2031 results->isMonochrome = (results->depthPerComponent == 0); |
2028 } | 2032 } |
2029 | 2033 |
2030 } // namespace content | 2034 } // namespace content |
OLD | NEW |