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

Side by Side Diff: content/browser/devtools/renderer_overrides_handler.cc

Issue 88033002: Add RGB565 Texture readback support in gl_helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected indentation. Created 6 years, 11 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) 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 "content/browser/devtools/renderer_overrides_handler.h" 5 #include "content/browser/devtools/renderer_overrides_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/barrier_closure.h" 10 #include "base/barrier_closure.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 gfx::Rect view_bounds = host->GetView()->GetViewBounds(); 198 gfx::Rect view_bounds = host->GetView()->GetViewBounds();
199 gfx::Size snapshot_size = gfx::ToFlooredSize( 199 gfx::Size snapshot_size = gfx::ToFlooredSize(
200 gfx::ScaleSize(view_bounds.size(), scale)); 200 gfx::ScaleSize(view_bounds.size(), scale));
201 201
202 view_port->CopyFromCompositingSurface( 202 view_port->CopyFromCompositingSurface(
203 view_bounds, snapshot_size, 203 view_bounds, snapshot_size,
204 base::Bind(&RendererOverridesHandler::ScreenshotCaptured, 204 base::Bind(&RendererOverridesHandler::ScreenshotCaptured,
205 weak_factory_.GetWeakPtr(), 205 weak_factory_.GetWeakPtr(),
206 scoped_refptr<DevToolsProtocol::Command>(), format, quality, 206 scoped_refptr<DevToolsProtocol::Command>(), format, quality,
207 last_compositor_frame_metadata_)); 207 last_compositor_frame_metadata_),
208 false);
208 } 209 }
209 210
210 void RendererOverridesHandler::ParseCaptureParameters( 211 void RendererOverridesHandler::ParseCaptureParameters(
211 DevToolsProtocol::Command* command, 212 DevToolsProtocol::Command* command,
212 std::string* format, 213 std::string* format,
213 int* quality, 214 int* quality,
214 double* scale) { 215 double* scale) {
215 *quality = kDefaultScreenshotQuality; 216 *quality = kDefaultScreenshotQuality;
216 *scale = 1; 217 *scale = 1;
217 double max_width = -1; 218 double max_width = -1;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 454 }
454 455
455 // Fallback to copying from compositing surface. 456 // Fallback to copying from compositing surface.
456 RenderWidgetHostViewPort* view_port = 457 RenderWidgetHostViewPort* view_port =
457 RenderWidgetHostViewPort::FromRWHV(host->GetView()); 458 RenderWidgetHostViewPort::FromRWHV(host->GetView());
458 459
459 view_port->CopyFromCompositingSurface( 460 view_port->CopyFromCompositingSurface(
460 view_bounds, snapshot_size, 461 view_bounds, snapshot_size,
461 base::Bind(&RendererOverridesHandler::ScreenshotCaptured, 462 base::Bind(&RendererOverridesHandler::ScreenshotCaptured,
462 weak_factory_.GetWeakPtr(), command, format, quality, 463 weak_factory_.GetWeakPtr(), command, format, quality,
463 last_compositor_frame_metadata_)); 464 last_compositor_frame_metadata_),
465 false);
464 return command->AsyncResponsePromise(); 466 return command->AsyncResponsePromise();
465 } 467 }
466 468
467 scoped_refptr<DevToolsProtocol::Response> 469 scoped_refptr<DevToolsProtocol::Response>
468 RendererOverridesHandler::PageCanScreencast( 470 RendererOverridesHandler::PageCanScreencast(
469 scoped_refptr<DevToolsProtocol::Command> command) { 471 scoped_refptr<DevToolsProtocol::Command> command) {
470 base::DictionaryValue* result = new base::DictionaryValue(); 472 base::DictionaryValue* result = new base::DictionaryValue();
471 #if defined(OS_ANDROID) 473 #if defined(OS_ANDROID)
472 result->SetBoolean(devtools::kResult, true); 474 result->SetBoolean(devtools::kResult, true);
473 #else 475 #else
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 return NULL; 972 return NULL;
971 } 973 }
972 event.data.pinchUpdate.scale = static_cast<float>(scale); 974 event.data.pinchUpdate.scale = static_cast<float>(scale);
973 } 975 }
974 976
975 host->ForwardGestureEvent(event); 977 host->ForwardGestureEvent(event);
976 return command->SuccessResponse(NULL); 978 return command->SuccessResponse(NULL);
977 } 979 }
978 980
979 } // namespace content 981 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698