diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 22:38:26 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 22:38:26 +0000 |
commit | f5be4197c63176e34d905ab2fba17c8e895f63ac (patch) | |
tree | b14192d92ebf183ccca26c73324a1167635de920 /content | |
parent | 7d3a0e352b91f3a650cd559d84c28bff13b85a7f (diff) | |
download | chromium_src-f5be4197c63176e34d905ab2fba17c8e895f63ac.zip chromium_src-f5be4197c63176e34d905ab2fba17c8e895f63ac.tar.gz chromium_src-f5be4197c63176e34d905ab2fba17c8e895f63ac.tar.bz2 |
Build BackingStoreSkia only if use_aura==1
On other platforms, it just slows down the build needlessly.
build/filename_rules.gypi doesn't do this automatically when
the filename ends in _aura, so rename backing_store_skia to
backing_store_aura.
BUG=none
TEST=none
TBR=avi
Review URL: https://chromiumcodereview.appspot.com/10536176
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/backing_store_aura.cc (renamed from content/browser/renderer_host/backing_store_skia.cc) | 18 | ||||
-rw-r--r-- | content/browser/renderer_host/backing_store_aura.h (renamed from content/browser/renderer_host/backing_store_skia.h) | 19 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 8 | ||||
-rw-r--r-- | content/content_browser.gypi | 4 |
4 files changed, 24 insertions, 25 deletions
diff --git a/content/browser/renderer_host/backing_store_skia.cc b/content/browser/renderer_host/backing_store_aura.cc index c89400e..0899420 100644 --- a/content/browser/renderer_host/backing_store_skia.cc +++ b/content/browser/renderer_host/backing_store_aura.cc @@ -2,7 +2,7 @@ // 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_skia.h" +#include "content/browser/renderer_host/backing_store_aura.h" #include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/render_process_host_impl.h" @@ -19,7 +19,7 @@ // Max height and width for layers static const int kMaxVideoLayerSize = 23170; -BackingStoreSkia::BackingStoreSkia(content::RenderWidgetHost* widget, +BackingStoreAura::BackingStoreAura(content::RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size), device_scale_factor_(content::GetDIPScaleFactor(widget->GetView())) { @@ -30,17 +30,17 @@ BackingStoreSkia::BackingStoreSkia(content::RenderWidgetHost* widget, canvas_.reset(new SkCanvas(bitmap_)); } -BackingStoreSkia::~BackingStoreSkia() { +BackingStoreAura::~BackingStoreAura() { } -void BackingStoreSkia::SkiaShowRect(const gfx::Point& point, +void BackingStoreAura::SkiaShowRect(const gfx::Point& point, gfx::Canvas* canvas) { const gfx::Point scaled_point = point.Scale(device_scale_factor_); canvas->sk_canvas()->drawBitmap(bitmap_, SkIntToScalar(scaled_point.x()), SkIntToScalar(scaled_point.y())); } -void BackingStoreSkia::ScaleFactorChanged(float device_scale_factor) { +void BackingStoreAura::ScaleFactorChanged(float device_scale_factor) { if (device_scale_factor == device_scale_factor_) return; @@ -66,13 +66,13 @@ void BackingStoreSkia::ScaleFactorChanged(float device_scale_factor) { bitmap_ = new_bitmap; } -size_t BackingStoreSkia::MemorySize() { +size_t BackingStoreAura::MemorySize() { // NOTE: The computation may be different when the canvas is a subrectangle of // a larger bitmap. return size().Scale(device_scale_factor_).GetArea() * 4; } -void BackingStoreSkia::PaintToBackingStore( +void BackingStoreAura::PaintToBackingStore( content::RenderProcessHost* process, TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect, @@ -122,7 +122,7 @@ void BackingStoreSkia::PaintToBackingStore( } } -void BackingStoreSkia::ScrollBackingStore(int dx, int dy, +void BackingStoreAura::ScrollBackingStore(int dx, int dy, const gfx::Rect& clip_rect, const gfx::Size& view_size) { gfx::Rect pixel_rect = clip_rect.Scale(device_scale_factor_); @@ -134,7 +134,7 @@ void BackingStoreSkia::ScrollBackingStore(int dx, int dy, bitmap_.scrollRect(&rect, dx, dy); } -bool BackingStoreSkia::CopyFromBackingStore(const gfx::Rect& rect, +bool BackingStoreAura::CopyFromBackingStore(const gfx::Rect& rect, skia::PlatformCanvas* output) { const int width = std::min(size().width(), rect.width()) * device_scale_factor_; diff --git a/content/browser/renderer_host/backing_store_skia.h b/content/browser/renderer_host/backing_store_aura.h index 064e33b..332abc0 100644 --- a/content/browser/renderer_host/backing_store_skia.h +++ b/content/browser/renderer_host/backing_store_aura.h @@ -2,8 +2,8 @@ // 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_BACKING_STORE_SKIA_H_ -#define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ +#ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_ +#define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_ #pragma once #include "base/memory/scoped_ptr.h" @@ -22,16 +22,15 @@ namespace content { class RenderProcessHost; } -// A backing store that uses skia. This is a temporary backing store used by -// RenderWidgetHostViewViews. In time, only GPU rendering will be used for -// RWHVV, and then this backing store will be removed. -class BackingStoreSkia : public BackingStore { +// A backing store that uses skia. This is the backing store used by +// RenderWidgetHostViewAura. +class BackingStoreAura : public BackingStore { public: - CONTENT_EXPORT BackingStoreSkia( + CONTENT_EXPORT BackingStoreAura( content::RenderWidgetHost* widget, const gfx::Size& size); - virtual ~BackingStoreSkia(); + virtual ~BackingStoreAura(); CONTENT_EXPORT void SkiaShowRect(const gfx::Point& point, gfx::Canvas* canvas); @@ -61,7 +60,7 @@ class BackingStoreSkia : public BackingStore { scoped_ptr<SkCanvas> canvas_; int device_scale_factor_; - DISALLOW_COPY_AND_ASSIGN(BackingStoreSkia); + DISALLOW_COPY_AND_ASSIGN(BackingStoreAura); }; -#endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_SKIA_H_ +#endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_AURA_H_ diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 3bbb9aa..a2a3608 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -12,7 +12,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop.h" #include "base/string_number_conversions.h" -#include "content/browser/renderer_host/backing_store_skia.h" +#include "content/browser/renderer_host/backing_store_aura.h" #include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/image_transport_client.h" #include "content/browser/renderer_host/render_widget_host_impl.h" @@ -440,7 +440,7 @@ void RenderWidgetHostViewAura::SelectionBoundsChanged( BackingStore* RenderWidgetHostViewAura::AllocBackingStore( const gfx::Size& size) { - return new BackingStoreSkia(host_, size); + return new BackingStoreAura(host_, size); } void RenderWidgetHostViewAura::CopyFromCompositingSurface( @@ -1137,7 +1137,7 @@ void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { BackingStore* backing_store = host_->GetBackingStore(true); paint_canvas_ = NULL; if (backing_store) { - static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect(gfx::Point(), + static_cast<BackingStoreAura*>(backing_store)->SkiaShowRect(gfx::Point(), canvas); } else { canvas->FillRect(gfx::Rect(window_->bounds().size()), SK_ColorWHITE); @@ -1149,7 +1149,7 @@ void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( if (!host_) return; - BackingStoreSkia* backing_store = static_cast<BackingStoreSkia*>( + BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( host_->GetBackingStore(false)); if (backing_store) // NULL in hardware path. backing_store->ScaleFactorChanged(device_scale_factor); diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 9916d15..38ef880 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -471,8 +471,8 @@ 'browser/renderer_host/backing_store_mac.mm', 'browser/renderer_host/backing_store_manager.cc', 'browser/renderer_host/backing_store_manager.h', - 'browser/renderer_host/backing_store_skia.cc', - 'browser/renderer_host/backing_store_skia.h', + 'browser/renderer_host/backing_store_aura.cc', + 'browser/renderer_host/backing_store_aura.h', 'browser/renderer_host/backing_store_win.cc', 'browser/renderer_host/backing_store_win.h', 'browser/renderer_host/buffered_resource_handler.cc', |