Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1144333004: Make WebView work for external displays (over Presentations). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move screen_android.cc from ui/gfx/ to ui/android/. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
8 9
9 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/callback_helpers.h" 13 #include "base/callback_helpers.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
17 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 static const char kAsyncReadBackString[] = "Compositing.CopyFromSurfaceTime"; 119 static const char kAsyncReadBackString[] = "Compositing.CopyFromSurfaceTime";
119 120
120 // Sends an acknowledgement to the renderer of a processed IME event. 121 // Sends an acknowledgement to the renderer of a processed IME event.
121 void SendImeEventAck(RenderWidgetHostImpl* host) { 122 void SendImeEventAck(RenderWidgetHostImpl* host) {
122 host->Send(new ViewMsg_ImeEventAck(host->GetRoutingID())); 123 host->Send(new ViewMsg_ImeEventAck(host->GetRoutingID()));
123 } 124 }
124 125
125 class GLHelperHolder 126 class GLHelperHolder
126 : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback { 127 : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback {
127 public: 128 public:
128 static GLHelperHolder* Create(); 129 static GLHelperHolder* Create(gfx::NativeWindow nativeWindow);
129 ~GLHelperHolder() override; 130 ~GLHelperHolder() override;
130 131
131 void Initialize(); 132 void Initialize(gfx::NativeWindow nativeWindow);
132 133
133 // WebGraphicsContextLostCallback implementation. 134 // WebGraphicsContextLostCallback implementation.
134 void onContextLost() override; 135 void onContextLost() override;
135 136
136 GLHelper* GetGLHelper() { return gl_helper_.get(); } 137 GLHelper* GetGLHelper() { return gl_helper_.get(); }
137 bool IsLost() { return !context_.get() || context_->isContextLost(); } 138 bool IsLost() { return !context_.get() || context_->isContextLost(); }
138 139
139 private: 140 private:
140 GLHelperHolder(); 141 GLHelperHolder();
141 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(); 142 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
143 CreateContext3D(gfx::NativeWindow nativeWindow);
142 144
143 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_; 145 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context_;
144 scoped_ptr<GLHelper> gl_helper_; 146 scoped_ptr<GLHelper> gl_helper_;
145 147
146 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder); 148 DISALLOW_COPY_AND_ASSIGN(GLHelperHolder);
147 }; 149 };
148 150
149 GLHelperHolder* GLHelperHolder::Create() { 151 GLHelperHolder* GLHelperHolder::Create(gfx::NativeWindow nativeWindow) {
150 GLHelperHolder* holder = new GLHelperHolder; 152 GLHelperHolder* holder = new GLHelperHolder;
151 holder->Initialize(); 153 holder->Initialize(nativeWindow);
152 154
153 return holder; 155 return holder;
154 } 156 }
155 157
156 GLHelperHolder::GLHelperHolder() { 158 GLHelperHolder::GLHelperHolder() {
157 } 159 }
158 160
159 GLHelperHolder::~GLHelperHolder() { 161 GLHelperHolder::~GLHelperHolder() {
160 } 162 }
161 163
162 void GLHelperHolder::Initialize() { 164 void GLHelperHolder::Initialize(gfx::NativeWindow nativeWindow) {
163 context_ = CreateContext3D(); 165 context_ = CreateContext3D(nativeWindow);
164 if (context_) { 166 if (context_) {
165 context_->setContextLostCallback(this); 167 context_->setContextLostCallback(this);
166 gl_helper_.reset(new GLHelper(context_->GetImplementation(), 168 gl_helper_.reset(new GLHelper(context_->GetImplementation(),
167 context_->GetContextSupport())); 169 context_->GetContextSupport()));
168 } 170 }
169 } 171 }
170 172
171 void GLHelperHolder::onContextLost() { 173 void GLHelperHolder::onContextLost() {
172 // Need to post a task because the command buffer client cannot be deleted 174 // Need to post a task because the command buffer client cannot be deleted
173 // from within this callback. 175 // from within this callback.
174 LOG(ERROR) << "Context lost."; 176 LOG(ERROR) << "Context lost.";
175 base::MessageLoop::current()->PostTask( 177 base::MessageLoop::current()->PostTask(
176 FROM_HERE, 178 FROM_HERE,
177 base::Bind(&RenderWidgetHostViewAndroid::OnContextLost)); 179 base::Bind(&RenderWidgetHostViewAndroid::OnContextLost));
178 } 180 }
179 181
180 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 182 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
181 GLHelperHolder::CreateContext3D() { 183 GLHelperHolder::CreateContext3D(gfx::NativeWindow nativeWindow) {
182 BrowserGpuChannelHostFactory* factory = 184 BrowserGpuChannelHostFactory* factory =
183 BrowserGpuChannelHostFactory::instance(); 185 BrowserGpuChannelHostFactory::instance();
184 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); 186 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
185 // GLHelper can only be used in asynchronous APIs for postprocessing after 187 // GLHelper can only be used in asynchronous APIs for postprocessing after
186 // Browser Compositor operations (i.e. readback). 188 // Browser Compositor operations (i.e. readback).
187 if (!gpu_channel_host.get()) { 189 if (!gpu_channel_host.get()) {
188 // The Browser Compositor is in charge of reestablishing the channel. 190 // The Browser Compositor is in charge of reestablishing the channel.
189 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); 191 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>();
190 } 192 }
191 193
192 blink::WebGraphicsContext3D::Attributes attrs; 194 blink::WebGraphicsContext3D::Attributes attrs;
193 attrs.shareResources = true; 195 attrs.shareResources = true;
194 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); 196 GURL url("chrome://gpu/RenderWidgetHostViewAndroid");
195 static const size_t kBytesPerPixel = 4; 197 static const size_t kBytesPerPixel = 4;
196 gfx::DeviceDisplayInfo display_info; 198 std::shared_ptr<gfx::DeviceDisplayInfo> display_info =
197 size_t full_screen_texture_size_in_bytes = display_info.GetDisplayHeight() * 199 nativeWindow->GetDeviceDisplayInfo();
198 display_info.GetDisplayWidth() * 200 size_t full_screen_texture_size_in_bytes = display_info->GetDisplayHeight() *
201 display_info->GetDisplayWidth() *
199 kBytesPerPixel; 202 kBytesPerPixel;
200 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 203 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
201 limits.command_buffer_size = 64 * 1024; 204 limits.command_buffer_size = 64 * 1024;
202 limits.start_transfer_buffer_size = 64 * 1024; 205 limits.start_transfer_buffer_size = 64 * 1024;
203 limits.min_transfer_buffer_size = 64 * 1024; 206 limits.min_transfer_buffer_size = 64 * 1024;
204 limits.max_transfer_buffer_size = std::min( 207 limits.max_transfer_buffer_size = std::min(
205 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 208 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
206 limits.mapped_memory_reclaim_limit = 209 limits.mapped_memory_reclaim_limit =
207 WebGraphicsContext3DCommandBufferImpl::kNoLimit; 210 WebGraphicsContext3DCommandBufferImpl::kNoLimit;
208 bool lose_context_when_out_of_memory = false; 211 bool lose_context_when_out_of_memory = false;
(...skipping 10 matching lines...) Expand all
219 context.get()).c_str()); 222 context.get()).c_str());
220 } else { 223 } else {
221 context.reset(); 224 context.reset();
222 } 225 }
223 226
224 return context.Pass(); 227 return context.Pass();
225 } 228 }
226 229
227 // This can only be used for readback postprocessing. It may return null if the 230 // This can only be used for readback postprocessing. It may return null if the
228 // channel was lost and not reestablished yet. 231 // channel was lost and not reestablished yet.
229 GLHelper* GetPostReadbackGLHelper() { 232 GLHelper* GetPostReadbackGLHelper(gfx::NativeWindow nativeWindow) {
230 static GLHelperHolder* g_readback_helper_holder = nullptr; 233 static GLHelperHolder* g_readback_helper_holder = nullptr;
231 234
232 if (g_readback_helper_holder && g_readback_helper_holder->IsLost()) { 235 if (g_readback_helper_holder && g_readback_helper_holder->IsLost()) {
233 delete g_readback_helper_holder; 236 delete g_readback_helper_holder;
234 g_readback_helper_holder = nullptr; 237 g_readback_helper_holder = nullptr;
235 } 238 }
236 239
237 if (!g_readback_helper_holder) 240 if (!g_readback_helper_holder)
238 g_readback_helper_holder = GLHelperHolder::Create(); 241 g_readback_helper_holder = GLHelperHolder::Create(nativeWindow);
239 242
240 return g_readback_helper_holder->GetGLHelper(); 243 return g_readback_helper_holder->GetGLHelper();
241 } 244 }
242 245
243 void CopyFromCompositingSurfaceFinished( 246 void CopyFromCompositingSurfaceFinished(
244 ReadbackRequestCallback& callback, 247 ReadbackRequestCallback& callback,
245 scoped_ptr<cc::SingleReleaseCallback> release_callback, 248 scoped_ptr<cc::SingleReleaseCallback> release_callback,
246 scoped_ptr<SkBitmap> bitmap, 249 scoped_ptr<SkBitmap> bitmap,
247 const base::TimeTicks& start_time, 250 const base::TimeTicks& start_time,
248 scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock, 251 scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
252 gfx::NativeWindow nativeWindow,
249 bool result) { 253 bool result) {
250 TRACE_EVENT0( 254 TRACE_EVENT0(
251 "cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceFinished"); 255 "cc", "RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceFinished");
252 bitmap_pixels_lock.reset(); 256 bitmap_pixels_lock.reset();
253 uint32 sync_point = 0; 257 uint32 sync_point = 0;
254 if (result) { 258 if (result) {
255 GLHelper* gl_helper = GetPostReadbackGLHelper(); 259 GLHelper* gl_helper = GetPostReadbackGLHelper(nativeWindow);
256 if (gl_helper) 260 if (gl_helper)
257 sync_point = gl_helper->InsertSyncPoint(); 261 sync_point = gl_helper->InsertSyncPoint();
258 } 262 }
259 bool lost_resource = sync_point == 0; 263 bool lost_resource = sync_point == 0;
260 release_callback->Run(sync_point, lost_resource); 264 release_callback->Run(sync_point, lost_resource);
261 UMA_HISTOGRAM_TIMES(kAsyncReadBackString, 265 UMA_HISTOGRAM_TIMES(kAsyncReadBackString,
262 base::TimeTicks::Now() - start_time); 266 base::TimeTicks::Now() - start_time);
263 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED; 267 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED;
264 callback.Run(*bitmap, response); 268 callback.Run(*bitmap, response);
265 } 269 }
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 scoped_refptr<cc::Layer> layer = CreateDelegatedLayer(); 926 scoped_refptr<cc::Layer> layer = CreateDelegatedLayer();
923 DCHECK(layer); 927 DCHECK(layer);
924 layer->SetHideLayerAndSubtree(true); 928 layer->SetHideLayerAndSubtree(true);
925 compositor->AttachLayerForReadback(layer); 929 compositor->AttachLayerForReadback(layer);
926 930
927 readback_layer = layer; 931 readback_layer = layer;
928 request = cc::CopyOutputRequest::CreateRequest( 932 request = cc::CopyOutputRequest::CreateRequest(
929 base::Bind(&RenderWidgetHostViewAndroid:: 933 base::Bind(&RenderWidgetHostViewAndroid::
930 PrepareTextureCopyOutputResultForDelegatedReadback, 934 PrepareTextureCopyOutputResultForDelegatedReadback,
931 dst_size_in_pixel, preferred_color_type, start_time, 935 dst_size_in_pixel, preferred_color_type, start_time,
932 readback_layer, callback)); 936 readback_layer, callback, content_view_core_window_android_));
933 if (!src_subrect_in_pixel.IsEmpty()) 937 if (!src_subrect_in_pixel.IsEmpty())
934 request->set_area(src_subrect_in_pixel); 938 request->set_area(src_subrect_in_pixel);
935 readback_layer->RequestCopyOfOutput(request.Pass()); 939 readback_layer->RequestCopyOfOutput(request.Pass());
936 } 940 }
937 941
938 void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame( 942 void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame(
939 const gfx::Rect& src_subrect, 943 const gfx::Rect& src_subrect,
940 const scoped_refptr<media::VideoFrame>& target, 944 const scoped_refptr<media::VideoFrame>& target,
941 const base::Callback<void(bool)>& callback) { 945 const base::Callback<void(bool)>& callback) {
942 NOTIMPLEMENTED(); 946 NOTIMPLEMENTED();
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 } 1544 }
1541 1545
1542 bool RenderWidgetHostViewAndroid::HasAcceleratedSurface( 1546 bool RenderWidgetHostViewAndroid::HasAcceleratedSurface(
1543 const gfx::Size& desired_size) { 1547 const gfx::Size& desired_size) {
1544 NOTREACHED(); 1548 NOTREACHED();
1545 return false; 1549 return false;
1546 } 1550 }
1547 1551
1548 void RenderWidgetHostViewAndroid::GetScreenInfo(blink::WebScreenInfo* result) { 1552 void RenderWidgetHostViewAndroid::GetScreenInfo(blink::WebScreenInfo* result) {
1549 // ScreenInfo isn't tied to the widget on Android. Always return the default. 1553 // ScreenInfo isn't tied to the widget on Android. Always return the default.
1550 RenderWidgetHostViewBase::GetDefaultScreenInfo(result); 1554 RenderWidgetHostViewBase::GetDefaultScreenInfo(result); // TODO fix
1551 } 1555 }
1552 1556
1553 // TODO(jrg): Find out the implications and answer correctly here, 1557 // TODO(jrg): Find out the implications and answer correctly here,
1554 // as we are returning the WebView and not root window bounds. 1558 // as we are returning the WebView and not root window bounds.
1555 gfx::Rect RenderWidgetHostViewAndroid::GetBoundsInRootWindow() { 1559 gfx::Rect RenderWidgetHostViewAndroid::GetBoundsInRootWindow() {
1556 return GetViewBounds(); 1560 return GetViewBounds();
1557 } 1561 }
1558 1562
1559 gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() { 1563 gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() {
1560 gfx::GLSurfaceHandle handle = 1564 gfx::GLSurfaceHandle handle =
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 } 1922 }
1919 1923
1920 // static 1924 // static
1921 void RenderWidgetHostViewAndroid:: 1925 void RenderWidgetHostViewAndroid::
1922 PrepareTextureCopyOutputResultForDelegatedReadback( 1926 PrepareTextureCopyOutputResultForDelegatedReadback(
1923 const gfx::Size& dst_size_in_pixel, 1927 const gfx::Size& dst_size_in_pixel,
1924 SkColorType color_type, 1928 SkColorType color_type,
1925 const base::TimeTicks& start_time, 1929 const base::TimeTicks& start_time,
1926 scoped_refptr<cc::Layer> readback_layer, 1930 scoped_refptr<cc::Layer> readback_layer,
1927 ReadbackRequestCallback& callback, 1931 ReadbackRequestCallback& callback,
1932 gfx::NativeWindow nativeWindow,
1928 scoped_ptr<cc::CopyOutputResult> result) { 1933 scoped_ptr<cc::CopyOutputResult> result) {
1929 readback_layer->RemoveFromParent(); 1934 readback_layer->RemoveFromParent();
1930 PrepareTextureCopyOutputResult( 1935 PrepareTextureCopyOutputResult(
1931 dst_size_in_pixel, color_type, start_time, callback, result.Pass()); 1936 dst_size_in_pixel, color_type, start_time, callback, nativeWindow,
1937 result.Pass());
1932 } 1938 }
1933 1939
1934 // static 1940 // static
1935 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( 1941 void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
1936 const gfx::Size& dst_size_in_pixel, 1942 const gfx::Size& dst_size_in_pixel,
1937 SkColorType color_type, 1943 SkColorType color_type,
1938 const base::TimeTicks& start_time, 1944 const base::TimeTicks& start_time,
1939 ReadbackRequestCallback& callback, 1945 ReadbackRequestCallback& callback,
1946 gfx::NativeWindow nativeWindow,
1940 scoped_ptr<cc::CopyOutputResult> result) { 1947 scoped_ptr<cc::CopyOutputResult> result) {
1941 base::ScopedClosureRunner scoped_callback_runner( 1948 base::ScopedClosureRunner scoped_callback_runner(
1942 base::Bind(callback, SkBitmap(), READBACK_FAILED)); 1949 base::Bind(callback, SkBitmap(), READBACK_FAILED));
1943 TRACE_EVENT0("cc", 1950 TRACE_EVENT0("cc",
1944 "RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult"); 1951 "RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult");
1945 1952
1946 if (!result->HasTexture() || result->IsEmpty() || result->size().IsEmpty()) 1953 if (!result->HasTexture() || result->IsEmpty() || result->size().IsEmpty())
1947 return; 1954 return;
1948 1955
1949 gfx::Size output_size_in_pixel; 1956 gfx::Size output_size_in_pixel;
1950 if (dst_size_in_pixel.IsEmpty()) 1957 if (dst_size_in_pixel.IsEmpty())
1951 output_size_in_pixel = result->size(); 1958 output_size_in_pixel = result->size();
1952 else 1959 else
1953 output_size_in_pixel = dst_size_in_pixel; 1960 output_size_in_pixel = dst_size_in_pixel;
1954 1961
1955 GLHelper* gl_helper = GetPostReadbackGLHelper(); 1962 GLHelper* gl_helper =
1963 GetPostReadbackGLHelper(nativeWindow);
1956 if (!gl_helper) 1964 if (!gl_helper)
1957 return; 1965 return;
1958 if (!gl_helper->IsReadbackConfigSupported(color_type)) 1966 if (!gl_helper->IsReadbackConfigSupported(color_type))
1959 color_type = kRGBA_8888_SkColorType; 1967 color_type = kRGBA_8888_SkColorType;
1960 scoped_ptr<SkBitmap> bitmap(new SkBitmap); 1968 scoped_ptr<SkBitmap> bitmap(new SkBitmap);
1961 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(), 1969 if (!bitmap->tryAllocPixels(SkImageInfo::Make(output_size_in_pixel.width(),
1962 output_size_in_pixel.height(), 1970 output_size_in_pixel.height(),
1963 color_type, 1971 color_type,
1964 kOpaque_SkAlphaType))) { 1972 kOpaque_SkAlphaType))) {
1965 scoped_callback_runner.Reset( 1973 scoped_callback_runner.Reset(
(...skipping 21 matching lines...) Expand all
1987 result->size(), 1995 result->size(),
1988 gfx::Rect(result->size()), 1996 gfx::Rect(result->size()),
1989 output_size_in_pixel, 1997 output_size_in_pixel,
1990 pixels, 1998 pixels,
1991 color_type, 1999 color_type,
1992 base::Bind(&CopyFromCompositingSurfaceFinished, 2000 base::Bind(&CopyFromCompositingSurfaceFinished,
1993 callback, 2001 callback,
1994 base::Passed(&release_callback), 2002 base::Passed(&release_callback),
1995 base::Passed(&bitmap), 2003 base::Passed(&bitmap),
1996 start_time, 2004 start_time,
1997 base::Passed(&bitmap_pixels_lock)), 2005 base::Passed(&bitmap_pixels_lock),
2006 nativeWindow),
1998 GLHelper::SCALER_QUALITY_GOOD); 2007 GLHelper::SCALER_QUALITY_GOOD);
1999 } 2008 }
2000 2009
2001 void RenderWidgetHostViewAndroid::OnStylusSelectBegin(float x0, 2010 void RenderWidgetHostViewAndroid::OnStylusSelectBegin(float x0,
2002 float y0, 2011 float y0,
2003 float x1, 2012 float x1,
2004 float y1) { 2013 float y1) {
2005 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1)); 2014 SelectBetweenCoordinates(gfx::PointF(x0, y0), gfx::PointF(x1, y1));
2006 } 2015 }
2007 2016
(...skipping 29 matching lines...) Expand all
2037 results->orientationAngle = display.RotationAsDegree(); 2046 results->orientationAngle = display.RotationAsDegree();
2038 results->orientationType = 2047 results->orientationType =
2039 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2048 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2040 gfx::DeviceDisplayInfo info; 2049 gfx::DeviceDisplayInfo info;
2041 results->depth = info.GetBitsPerPixel(); 2050 results->depth = info.GetBitsPerPixel();
2042 results->depthPerComponent = info.GetBitsPerComponent(); 2051 results->depthPerComponent = info.GetBitsPerComponent();
2043 results->isMonochrome = (results->depthPerComponent == 0); 2052 results->isMonochrome = (results->depthPerComponent == 0);
2044 } 2053 }
2045 2054
2046 } // namespace content 2055 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698