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

Unified Diff: content/browser/aura/software_output_device_x11.cc

Issue 140753005: Add the UI compositor to the Mac build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/aura/software_output_device_x11.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/aura/software_output_device_x11.cc
diff --git a/content/browser/aura/software_output_device_x11.cc b/content/browser/aura/software_output_device_x11.cc
deleted file mode 100644
index 51e54db4487dad26dd078b6cae7409bbad809879..0000000000000000000000000000000000000000
--- a/content/browser/aura/software_output_device_x11.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/aura/software_output_device_x11.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include "content/public/browser/browser_thread.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "ui/compositor/compositor.h"
-#include "ui/gfx/x/x11_types.h"
-
-namespace content {
-
-SoftwareOutputDeviceX11::SoftwareOutputDeviceX11(ui::Compositor* compositor)
- : compositor_(compositor), display_(gfx::GetXDisplay()), gc_(NULL) {
- // TODO(skaslev) Remove this when crbug.com/180702 is fixed.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- gc_ = XCreateGC(display_, compositor_->widget(), 0, NULL);
- if (!XGetWindowAttributes(display_, compositor_->widget(), &attributes_)) {
- LOG(ERROR) << "XGetWindowAttributes failed for window "
- << compositor_->widget();
- return;
- }
-}
-
-SoftwareOutputDeviceX11::~SoftwareOutputDeviceX11() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- XFreeGC(display_, gc_);
-}
-
-void SoftwareOutputDeviceX11::EndPaint(cc::SoftwareFrameData* frame_data) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(device_);
- DCHECK(frame_data);
-
- if (!device_)
- return;
-
- SoftwareOutputDevice::EndPaint(frame_data);
-
- gfx::Rect rect = damage_rect_;
- rect.Intersect(gfx::Rect(viewport_size_));
- if (rect.IsEmpty())
- return;
-
- // TODO(jbauman): Switch to XShmPutImage since it's async.
- const SkBitmap& bitmap = device_->accessBitmap(false);
- gfx::PutARGBImage(display_,
- attributes_.visual,
- attributes_.depth,
- compositor_->widget(),
- gc_,
- static_cast<const uint8*>(bitmap.getPixels()),
- viewport_size_.width(),
- viewport_size_.height(),
- rect.x(),
- rect.y(),
- rect.x(),
- rect.y(),
- rect.width(),
- rect.height());
-}
-
-} // namespace content
« no previous file with comments | « content/browser/aura/software_output_device_x11.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698