Skip to content

Commit

Permalink
Refactor: Move app/surface to ui/gfx/surface.
Browse files Browse the repository at this point in the history
This is progress towards moving app/gfx/gl to ui/gfx/gl. Currently, surface depends on gl, but gl depends on app_base (which contains surface). This refactor gets rid of this potential cyclic dependency.

surface.gyp is in a separate file (not a .gypi include) because cyclic dependency checking is at the file level (not target level).

BUG=none
TEST=by hand and try bots

Review URL: http://codereview.chromium.org/6718027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79396 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
backer@chromium.org committed Mar 25, 2011
1 parent 13ffb98 commit b9b751f
Show file tree
Hide file tree
Showing 44 changed files with 146 additions and 91 deletions.
8 changes: 0 additions & 8 deletions app/app_base.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@
'sql/statement.h',
'sql/transaction.cc',
'sql/transaction.h',
'surface/accelerated_surface_mac.cc',
'surface/accelerated_surface_mac.h',
'surface/io_surface_support_mac.cc',
'surface/io_surface_support_mac.h',
'surface/transport_dib.h',
'surface/transport_dib_linux.cc',
'surface/transport_dib_mac.cc',
'surface/transport_dib_win.cc',
'win/iat_patch_function.cc',
'win/iat_patch_function.h',
'win/scoped_co_mem.h',
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/renderer_host/browser_render_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <queue>
#include <string>

#include "app/surface/transport_dib.h"
#include "base/platform_file.h"
#include "base/process.h"
#include "base/scoped_callback_factory.h"
Expand All @@ -22,6 +21,7 @@
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
#include "ui/gfx/surface/transport_dib.h"

class CommandLine;
class RendererMainThread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"

#include "app/surface/io_surface_support_mac.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
Expand Down Expand Up @@ -43,6 +42,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebInputEventFactory.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "ui/gfx/gl/gl_switches.h"
#include "ui/gfx/surface/io_surface_support_mac.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/plugins/npapi/webplugin.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "base/stringprintf.h"
#include "chrome/browser/history/top_sites.h"
Expand All @@ -17,6 +16,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/surface/transport_dib.h"

static const int kBitmapWidth = 100;
static const int kBitmapHeight = 100;
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'../third_party/libxml/libxml.gyp:libxml',
'../third_party/npapi/npapi.gyp:npapi',
'../ui/base/strings/ui_strings.gyp:ui_strings',
'../ui/gfx/surface/surface.gyp:surface',
'../webkit/support/webkit_support.gyp:appcache',
'../webkit/support/webkit_support.gyp:blob',
'../webkit/support/webkit_support.gyp:database',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'../third_party/icu/icu.gyp:icuuc',
'../third_party/npapi/npapi.gyp:npapi',
'../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
'../ui/gfx/surface/surface.gyp:surface',
'../webkit/support/webkit_support.gyp:glue',
'../webkit/support/webkit_support.gyp:webkit_gpu',
'../webkit/support/webkit_support.gyp:webkit_resources',
Expand Down
4 changes: 2 additions & 2 deletions chrome/renderer/mock_render_process.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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 "chrome/renderer/mock_render_process.h"

#include "app/surface/transport_dib.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/surface/transport_dib.h"

MockRenderProcess::MockRenderProcess()
: transport_dib_next_sequence_number_(0) {
Expand Down
4 changes: 2 additions & 2 deletions chrome/renderer/nacl_desc_wrapper_chrome.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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 "app/surface/transport_dib.h"
#include "base/shared_memory.h"
#include "base/sync_socket.h"
#include "native_client/src/trusted/desc/nacl_desc_base.h"
#include "native_client/src/trusted/desc/nacl_desc_sync_socket.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "ui/gfx/surface/transport_dib.h"

namespace nacl {

Expand Down
4 changes: 2 additions & 2 deletions chrome/renderer/render_process_impl.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -12,7 +12,6 @@

#include "chrome/renderer/render_process_impl.h"

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
Expand All @@ -34,6 +33,7 @@
#include "media/base/media.h"
#include "media/base/media_switches.h"
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/surface/transport_dib.h"
#include "webkit/plugins/npapi/plugin_instance.h"
#include "webkit/plugins/npapi/plugin_lib.h"
#include "webkit/glue/webkit_glue.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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/renderer_host/accelerated_surface_container_mac.h"

#include "app/surface/io_surface_support_mac.h"
#include "base/logging.h"
#include "content/browser/renderer_host/accelerated_surface_container_manager_mac.h"
#include "ui/gfx/surface/io_surface_support_mac.h"
#include "webkit/plugins/npapi/webplugin.h"

AcceleratedSurfaceContainerMac::AcceleratedSurfaceContainerMac(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

#ifndef CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_
#define CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_
#ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_
#define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_
#pragma once

// The "GPU plugin" is currently implemented as a special kind of
Expand All @@ -29,12 +29,12 @@
#include <CoreFoundation/CoreFoundation.h>
#include <OpenGL/OpenGL.h>

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/scoped_ptr.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/surface/transport_dib.h"

namespace webkit {
namespace npapi {
Expand Down Expand Up @@ -149,4 +149,4 @@ class AcceleratedSurfaceContainerMac {
DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac);
};

#endif // CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_
#endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

#ifndef CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
#define CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
#ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_H_
#define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_H_
#pragma once

#include <OpenGL/OpenGL.h>
#include <map>

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "base/synchronization/lock.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/surface/transport_dib.h"

namespace webkit {
namespace npapi {
Expand Down Expand Up @@ -122,4 +122,4 @@ class AcceleratedSurfaceContainerManagerMac {
DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac);
};

#endif // CONTENT_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
#endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MANAGER_MAC_H_
4 changes: 2 additions & 2 deletions content/browser/renderer_host/backing_store.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -8,9 +8,9 @@

#include <vector>

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "ui/gfx/size.h"
#include "ui/gfx/surface/transport_dib.h"

class RenderProcessHost;
class RenderWidgetHost;
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/backing_store_mac.mm
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

#import <Cocoa/Cocoa.h>

#include "content/browser/renderer_host/backing_store_mac.h"

#include "app/surface/transport_dib.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
Expand All @@ -18,6 +17,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/surface/transport_dib.h"

// Mac Backing Stores:
//
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/backing_store_manager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -8,11 +8,11 @@

#include <vector>

#include "app/surface/transport_dib.h"
#include "base/basictypes.h"
#include "base/process.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
#include "ui/gfx/surface/transport_dib.h"

class BackingStore;
class RenderWidgetHost;
Expand Down
7 changes: 4 additions & 3 deletions content/browser/renderer_host/backing_store_win.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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/renderer_host/backing_store_win.h"

#include "app/surface/transport_dib.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/surface/transport_dib.h"

namespace {

Expand Down Expand Up @@ -69,7 +69,8 @@ void CallStretchDIBits(HDC hdc, int dest_x, int dest_y, int dest_w, int dest_h,

} // namespace

BackingStoreWin::BackingStoreWin(RenderWidgetHost* widget, const gfx::Size& size)
BackingStoreWin::BackingStoreWin(RenderWidgetHost* widget,
const gfx::Size& size)
: BackingStore(widget, size),
backing_store_dib_(NULL),
original_bitmap_(NULL) {
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/backing_store_x.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -18,7 +18,6 @@
#include <utility>
#include <limits>

#include "app/surface/transport_dib.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
Expand All @@ -29,6 +28,7 @@
#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_util_internal.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/surface/transport_dib.h"

// Assume that somewhere along the line, someone will do width * height * 4
// with signed numbers. If the maximum value is 2**31, then 2**31 / 4 =
Expand Down
2 changes: 1 addition & 1 deletion content/browser/renderer_host/render_message_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <string>
#include <vector>

#include "app/surface/transport_dib.h"
#include "base/file_path.h"
#include "base/linked_ptr.h"
#include "base/shared_memory.h"
Expand All @@ -27,6 +26,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/surface/transport_dib.h"

class ChromeURLRequestContext;
struct FontDescriptor;
Expand Down
2 changes: 1 addition & 1 deletion content/browser/renderer_host/render_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

#include <set>

#include "app/surface/transport_dib.h"
#include "base/id_map.h"
#include "base/process.h"
#include "base/process_util.h"
#include "base/scoped_ptr.h"
#include "base/time.h"
#include "chrome/common/visitedlink_common.h"
#include "ipc/ipc_sync_channel.h"
#include "ui/gfx/surface/transport_dib.h"

class Profile;
class URLRequestContextGetter;
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/render_widget_helper.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -8,7 +8,6 @@

#include <map>

#include "app/surface/transport_dib.h"
#include "base/atomic_sequence_num.h"
#include "base/hash_tables.h"
#include "base/process.h"
Expand All @@ -17,6 +16,7 @@
#include "base/synchronization/waitable_event.h"
#include "content/common/window_container_type.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
#include "ui/gfx/surface/transport_dib.h"

namespace IPC {
class Message;
Expand Down
4 changes: 2 additions & 2 deletions content/browser/renderer_host/render_widget_host.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -10,7 +10,6 @@
#include <string>
#include <vector>

#include "app/surface/transport_dib.h"
#include "base/gtest_prod_util.h"
#include "base/process_util.h"
#include "base/scoped_ptr.h"
Expand All @@ -26,6 +25,7 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
#include "ui/gfx/surface/transport_dib.h"

namespace gfx {
class Rect;
Expand Down
Loading

0 comments on commit b9b751f

Please sign in to comment.