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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2629683002: Revert of android: Remove DeviceDisplayInfo usage from ComopsitorImpl (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index adbbd6f2d4e13d0a9561a7771f434e30f185a3ad..affcac97c7bc4fadd00493613fe463819d281457 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -66,8 +66,7 @@
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
#include "ui/android/window_android.h"
-#include "ui/display/display.h"
-#include "ui/display/screen.h"
+#include "ui/gfx/android/device_display_info.h"
#include "ui/gfx/swap_result.h"
namespace gpu {
@@ -80,14 +79,11 @@
const unsigned int kMaxDisplaySwapBuffers = 1U;
-gpu::SharedMemoryLimits GetCompositorContextSharedMemoryLimits(
- gfx::NativeWindow window) {
+gpu::SharedMemoryLimits GetCompositorContextSharedMemoryLimits() {
constexpr size_t kBytesPerPixel = 4;
- const gfx::Size size = display::Screen::GetScreen()
- ->GetDisplayNearestWindow(window)
- .GetSizeInPixel();
const size_t full_screen_texture_size_in_bytes =
- size.width() * size.height() * kBytesPerPixel;
+ gfx::DeviceDisplayInfo().GetDisplayHeight() *
+ gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
gpu::SharedMemoryLimits limits;
// This limit is meant to hold the contents of the display compositor
@@ -607,8 +603,7 @@
scoped_refptr<cc::ContextProvider> context_provider =
ContextProviderFactoryImpl::GetInstance()
->CreateDisplayContextProvider(
- surface_handle_,
- GetCompositorContextSharedMemoryLimits(root_window_),
+ surface_handle_, GetCompositorContextSharedMemoryLimits(),
GetCompositorContextAttributes(has_transparent_background_),
false /*support_locking*/, false /*automatic_flushes*/,
std::move(gpu_channel_host));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698