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

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

Issue 2615793003: android: Remove DeviceDisplayInfo usage from ComopsitorImpl (Closed)
Patch Set: const 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 affcac97c7bc4fadd00493613fe463819d281457..adbbd6f2d4e13d0a9561a7771f434e30f185a3ad 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -66,7 +66,8 @@
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
#include "ui/android/window_android.h"
-#include "ui/gfx/android/device_display_info.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/gfx/swap_result.h"
namespace gpu {
@@ -79,11 +80,14 @@ namespace {
const unsigned int kMaxDisplaySwapBuffers = 1U;
-gpu::SharedMemoryLimits GetCompositorContextSharedMemoryLimits() {
+gpu::SharedMemoryLimits GetCompositorContextSharedMemoryLimits(
+ gfx::NativeWindow window) {
constexpr size_t kBytesPerPixel = 4;
+ const gfx::Size size = display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(window)
+ .GetSizeInPixel();
const size_t full_screen_texture_size_in_bytes =
- gfx::DeviceDisplayInfo().GetDisplayHeight() *
- gfx::DeviceDisplayInfo().GetDisplayWidth() * kBytesPerPixel;
+ size.width() * size.height() * kBytesPerPixel;
gpu::SharedMemoryLimits limits;
// This limit is meant to hold the contents of the display compositor
@@ -603,7 +607,8 @@ void CompositorImpl::OnGpuChannelEstablished(
scoped_refptr<cc::ContextProvider> context_provider =
ContextProviderFactoryImpl::GetInstance()
->CreateDisplayContextProvider(
- surface_handle_, GetCompositorContextSharedMemoryLimits(),
+ surface_handle_,
+ GetCompositorContextSharedMemoryLimits(root_window_),
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