ChromeCanvas->gfx::Canvas

Rename files too.

TBR=brettw

http://crbug.com/11387
Review URL: http://codereview.chromium.org/113443

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16148 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
ben@chromium.org
2009-05-15 07:37:29 +00:00
commit 0b74269f91
165 arquivos alterados com 648 adições e 634 exclusões
+4 -4
Ver Arquivo
@@ -1,11 +1,11 @@
include_rules = [
# TODO(beng): Modify this link to be more specific about what resource
# headers are included once app gets its own strings.
"+grit",
# TODO(beng): swap these with app/views specific generated resources.
"+grit/generated_resources.h",
"+grit/locale_settings.h",
"+grit/theme_resources.h",
"+net",
# TODO(beng): Sever these links once we have extracted all deps from
# chrome/common.
"+chrome/common/chrome_paths.h",
"+skia",
]
+11 -11
Ver Arquivo
@@ -125,23 +125,15 @@
Name="gfx"
>
<File
RelativePath=".\gfx\chrome_canvas.cc"
RelativePath=".\gfx\canvas.cc"
>
</File>
<File
RelativePath=".\gfx\chrome_canvas.h"
RelativePath=".\gfx\canvas.h"
>
</File>
<File
RelativePath=".\gfx\chrome_canvas_win.cc"
>
</File>
<File
RelativePath=".\gfx\chrome_font.h"
>
</File>
<File
RelativePath=".\gfx\chrome_font_win.cc"
RelativePath=".\gfx\canvas_win.cc"
>
</File>
<File
@@ -156,6 +148,14 @@
RelativePath=".\gfx\favicon_size.h"
>
</File>
<File
RelativePath=".\gfx\font.h"
>
</File>
<File
RelativePath=".\gfx\font_win.cc"
>
</File>
<File
RelativePath=".\gfx\icon_util.cc"
>
+37 -40
Ver Arquivo
@@ -2,17 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include <limits>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkShader.h"
bool ChromeCanvas::GetClipRect(gfx::Rect* r) {
namespace gfx {
bool Canvas::GetClipRect(gfx::Rect* r) {
SkRect clip;
if (!getClipBounds(&clip)) {
if (r)
@@ -25,30 +27,29 @@ bool ChromeCanvas::GetClipRect(gfx::Rect* r) {
return true;
}
bool ChromeCanvas::ClipRectInt(int x, int y, int w, int h) {
bool Canvas::ClipRectInt(int x, int y, int w, int h) {
SkRect new_clip;
new_clip.set(SkIntToScalar(x), SkIntToScalar(y),
SkIntToScalar(x + w), SkIntToScalar(y + h));
return clipRect(new_clip);
}
bool ChromeCanvas::IntersectsClipRectInt(int x, int y, int w, int h) {
bool Canvas::IntersectsClipRectInt(int x, int y, int w, int h) {
SkRect clip;
return getClipBounds(&clip) &&
clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w),
SkIntToScalar(y + h));
}
void ChromeCanvas::TranslateInt(int x, int y) {
void Canvas::TranslateInt(int x, int y) {
translate(SkIntToScalar(x), SkIntToScalar(y));
}
void ChromeCanvas::ScaleInt(int x, int y) {
void Canvas::ScaleInt(int x, int y) {
scale(SkIntToScalar(x), SkIntToScalar(y));
}
void ChromeCanvas::FillRectInt(const SkColor& color,
int x, int y, int w, int h) {
void Canvas::FillRectInt(const SkColor& color, int x, int y, int w, int h) {
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
@@ -56,20 +57,17 @@ void ChromeCanvas::FillRectInt(const SkColor& color,
FillRectInt(x, y, w, h, paint);
}
void ChromeCanvas::FillRectInt(int x, int y, int w, int h,
const SkPaint& paint) {
void Canvas::FillRectInt(int x, int y, int w, int h, const SkPaint& paint) {
SkIRect rc = {x, y, x + w, y + h};
drawIRect(rc, paint);
}
void ChromeCanvas::DrawRectInt(const SkColor& color,
int x, int y, int w, int h) {
void Canvas::DrawRectInt(const SkColor& color, int x, int y, int w, int h) {
DrawRectInt(color, x, y, w, h, SkPorterDuff::kSrcOver_Mode);
}
void ChromeCanvas::DrawRectInt(const SkColor& color,
int x, int y, int w, int h,
SkPorterDuff::Mode mode) {
void Canvas::DrawRectInt(const SkColor& color, int x, int y, int w, int h,
SkPorterDuff::Mode mode) {
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kStroke_Style);
@@ -83,8 +81,7 @@ void ChromeCanvas::DrawRectInt(const SkColor& color,
drawIRect(rc, paint);
}
void ChromeCanvas::DrawLineInt(const SkColor& color,
int x1, int y1, int x2, int y2) {
void Canvas::DrawLineInt(const SkColor& color, int x1, int y1, int x2, int y2) {
SkPaint paint;
paint.setColor(color);
paint.setStrokeWidth(SkIntToScalar(1));
@@ -92,7 +89,7 @@ void ChromeCanvas::DrawLineInt(const SkColor& color,
SkIntToScalar(y2), paint);
}
void ChromeCanvas::DrawFocusRect(int x, int y, int width, int height) {
void Canvas::DrawFocusRect(int x, int y, int width, int height) {
// Create a 2D bitmap containing alternating on/off pixels - we do this
// so that you never get two pixels of the same color around the edges
// of the focus rect (this may mean that opposing edges of the rect may
@@ -146,28 +143,28 @@ void ChromeCanvas::DrawFocusRect(int x, int y, int width, int height) {
drawRect(rect, paint);
}
void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {
void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {
drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y));
}
void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y,
const SkPaint& paint) {
void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int x, int y,
const SkPaint& paint) {
drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y), &paint);
}
void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
int src_w, int src_h, int dest_x, int dest_y,
int dest_w, int dest_h,
bool filter) {
void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
int src_w, int src_h, int dest_x, int dest_y,
int dest_w, int dest_h,
bool filter) {
SkPaint p;
DrawBitmapInt(bitmap, src_x, src_y, src_w, src_h, dest_x, dest_y,
dest_w, dest_h, filter, p);
}
void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
int src_w, int src_h, int dest_x, int dest_y,
int dest_w, int dest_h,
bool filter, const SkPaint& paint) {
void Canvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
int src_w, int src_h, int dest_x, int dest_y,
int dest_w, int dest_h,
bool filter, const SkPaint& paint) {
DLOG_ASSERT(src_x + src_w < std::numeric_limits<int16_t>::max() &&
src_y + src_h < std::numeric_limits<int16_t>::max());
if (src_w <= 0 || src_h <= 0 || dest_w <= 0 || dest_h <= 0) {
@@ -216,22 +213,20 @@ void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
drawRect(dest_rect, p);
}
void ChromeCanvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color,
int x, int y,
int w, int h) {
void Canvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color,
int x, int y, int w, int h) {
DrawStringInt(text, font, color, x, y, w, h,
l10n_util::DefaultCanvasTextAlignment());
}
void ChromeCanvas::TileImageInt(const SkBitmap& bitmap,
int x, int y, int w, int h) {
void Canvas::TileImageInt(const SkBitmap& bitmap, int x, int y, int w, int h) {
TileImageInt(bitmap, 0, 0, x, y, w, h);
}
void ChromeCanvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
int dest_x, int dest_y, int w, int h) {
void Canvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
int dest_x, int dest_y, int w, int h) {
if (!IntersectsClipRectInt(dest_x, dest_y, w, h))
return;
@@ -253,7 +248,7 @@ void ChromeCanvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
restore();
}
SkBitmap ChromeCanvas::ExtractBitmap() {
SkBitmap Canvas::ExtractBitmap() {
const SkBitmap& device_bitmap = getDevice()->accessBitmap(false);
// Make a bitmap to return, and a canvas to draw into it. We don't just want
@@ -263,3 +258,5 @@ SkBitmap ChromeCanvas::ExtractBitmap() {
device_bitmap.copyTo(&result, SkBitmap::kARGB_8888_Config);
return result;
}
} // namespace gfx
+20 -20
Ver Arquivo
@@ -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 APP_GFX_CHROME_CANVAS_H_
#define APP_GFX_CHROME_CANVAS_H_
#ifndef APP_GFX_CANVAS_H_
#define APP_GFX_CANVAS_H_
#if defined(OS_WIN)
#include <windows.h>
@@ -14,19 +14,17 @@
#include "base/basictypes.h"
#include "skia/ext/platform_canvas.h"
namespace gfx {
class Font;
class Rect;
}
#if defined(OS_LINUX)
typedef struct _cairo cairo_t;
#endif
// ChromeCanvas is the SkCanvas used by Views for all painting. It
// provides a handful of methods for the common operations used throughout
// Views. With few exceptions, you should NOT create a ChromeCanvas directly,
// rather one will be passed to you via the various paint methods in view.
namespace gfx {
class Font;
class Rect;
// Canvas is a SkCanvas subclass that provides a number of methods for common
// operations used throughout an application built using base/gfx and app/gfx.
//
// All methods that take integer arguments (as is used throughout views)
// end with Int. If you need to use methods provided by the superclass
@@ -39,7 +37,7 @@ typedef struct _cairo cairo_t;
// source and destination colors are combined. Unless otherwise specified,
// the variant that does not take a SkPorterDuff::Mode uses a transfer mode
// of kSrcOver_Mode.
class ChromeCanvas : public skia::PlatformCanvas {
class Canvas : public skia::PlatformCanvas {
public:
// Specifies the alignment for text rendered with the DrawStringInt method.
enum {
@@ -69,13 +67,13 @@ class ChromeCanvas : public skia::PlatformCanvas {
CHARACTER_BREAK = 1024,
};
// Creates an empty ChromeCanvas. Callers must use initialize before using
// the canvas.
ChromeCanvas();
// Creates an empty Canvas. Callers must use initialize before using the
// canvas.
Canvas();
ChromeCanvas(int width, int height, bool is_opaque);
Canvas(int width, int height, bool is_opaque);
virtual ~ChromeCanvas();
virtual ~Canvas();
// Retrieves the clip rectangle and sets it in the specified rectangle if any.
// Returns true if the clip rect is non-empty.
@@ -207,11 +205,13 @@ class ChromeCanvas : public skia::PlatformCanvas {
int flags);
#endif
DISALLOW_EVIL_CONSTRUCTORS(ChromeCanvas);
DISALLOW_COPY_AND_ASSIGN(Canvas);
};
#if defined(OS_WIN) || defined(OS_LINUX)
typedef skia::CanvasPaintT<ChromeCanvas> ChromeCanvasPaint;
typedef skia::CanvasPaintT<Canvas> CanvasPaint;
#endif
#endif // APP_GFX_CHROME_CANVAS_H_
} // namespace gfx;
#endif // #ifndef APP_GFX_CANVAS_H_
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include <pango/pango.h>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -41,24 +41,26 @@ PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font) {
} // namespace
ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque)
namespace gfx {
Canvas::Canvas(int width, int height, bool is_opaque)
: skia::PlatformCanvasLinux(width, height, is_opaque) {
}
ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasLinux() {
Canvas::Canvas() : skia::PlatformCanvasLinux() {
}
ChromeCanvas::~ChromeCanvas() {
Canvas::~Canvas() {
}
// static
void ChromeCanvas::SizeStringInt(const std::wstring& text,
const gfx::Font& font,
int* width, int* height, int flags) {
void Canvas::SizeStringInt(const std::wstring& text,
const gfx::Font& font,
int* width, int* height, int flags) {
NOTIMPLEMENTED();
}
void ChromeCanvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
void Canvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
const SkMatrix& skia_matrix = getTotalMatrix();
cairo_matrix_t cairo_matrix;
cairo_matrix_init(&cairo_matrix,
@@ -71,10 +73,10 @@ void ChromeCanvas::ApplySkiaMatrixToCairoContext(cairo_t* cr) {
cairo_set_matrix(cr, &cairo_matrix);
}
void ChromeCanvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color, int x, int y, int w,
int h, int flags) {
void Canvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color, int x, int y, int w, int h,
int flags) {
cairo_surface_t* surface = beginPlatformPaint();
cairo_t* cr = cairo_create(surface);
// We're going to draw onto the surface directly. This circumvents the matrix
@@ -88,8 +90,8 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
SkColorGetG(color) / 255.0,
SkColorGetB(color) / 255.0);
// TODO(deanm): Implement the rest of the ChromeCanvas flags.
if (!(flags & ChromeCanvas::NO_ELLIPSIS))
// TODO(deanm): Implement the rest of the Canvas flags.
if (!(flags & Canvas::NO_ELLIPSIS))
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
pango_layout_set_width(layout, w * PANGO_SCALE);
@@ -119,9 +121,9 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
int width, height;
pango_layout_get_size(layout, &width, &height);
if (flags & ChromeCanvas::TEXT_VALIGN_TOP) {
if (flags & Canvas::TEXT_VALIGN_TOP) {
// Cairo should draw from the top left corner already.
} else if (flags & ChromeCanvas::TEXT_VALIGN_BOTTOM) {
} else if (flags & Canvas::TEXT_VALIGN_BOTTOM) {
y = y + (h - (height / PANGO_SCALE));
} else {
// Vertically centered.
@@ -135,3 +137,5 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text,
cairo_destroy(cr);
// NOTE: beginPlatformPaint returned its surface, we shouldn't destroy it.
}
} // namespace gfx
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include <limits>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/gfx/rect.h"
#include "third_party/skia/include/core/SkShader.h"
@@ -33,47 +33,47 @@ void DoDrawText(HDC hdc, const std::wstring& text,
DrawText(hdc, string_ptr, string_size, text_bounds, flags);
}
// Compute the windows flags necessary to implement the provided text
// ChromeCanvas flags.
// Compute the windows flags necessary to implement the provided text Canvas
// flags.
int ComputeFormatFlags(int flags, const std::wstring& text) {
int f = 0;
// Setting the text alignment explicitly in case it hasn't already been set.
// This will make sure that we don't align text to the left on RTL locales
// just because no alignment flag was passed to DrawStringInt().
if (!(flags & (ChromeCanvas::TEXT_ALIGN_CENTER |
ChromeCanvas::TEXT_ALIGN_RIGHT |
ChromeCanvas::TEXT_ALIGN_LEFT))) {
if (!(flags & (gfx::Canvas::TEXT_ALIGN_CENTER |
gfx::Canvas::TEXT_ALIGN_RIGHT |
gfx::Canvas::TEXT_ALIGN_LEFT))) {
flags |= l10n_util::DefaultCanvasTextAlignment();
}
if (flags & ChromeCanvas::HIDE_PREFIX)
if (flags & gfx::Canvas::HIDE_PREFIX)
f |= DT_HIDEPREFIX;
else if ((flags & ChromeCanvas::SHOW_PREFIX) == 0)
else if ((flags & gfx::Canvas::SHOW_PREFIX) == 0)
f |= DT_NOPREFIX;
if (flags & ChromeCanvas::MULTI_LINE) {
if (flags & gfx::Canvas::MULTI_LINE) {
f |= DT_WORDBREAK;
if (flags & ChromeCanvas::CHARACTER_BREAK)
if (flags & gfx::Canvas::CHARACTER_BREAK)
f |= DT_EDITCONTROL;
} else {
f |= DT_SINGLELINE | DT_VCENTER;
if (!(flags & ChromeCanvas::NO_ELLIPSIS))
if (!(flags & gfx::Canvas::NO_ELLIPSIS))
f |= DT_END_ELLIPSIS;
}
// vertical alignment
if (flags & ChromeCanvas::TEXT_VALIGN_TOP)
if (flags & gfx::Canvas::TEXT_VALIGN_TOP)
f |= DT_TOP;
else if (flags & ChromeCanvas::TEXT_VALIGN_BOTTOM)
else if (flags & gfx::Canvas::TEXT_VALIGN_BOTTOM)
f |= DT_BOTTOM;
else
f |= DT_VCENTER;
// horizontal alignment
if (flags & ChromeCanvas::TEXT_ALIGN_CENTER)
if (flags & gfx::Canvas::TEXT_ALIGN_CENTER)
f |= DT_CENTER;
else if (flags & ChromeCanvas::TEXT_ALIGN_RIGHT)
else if (flags & gfx::Canvas::TEXT_ALIGN_RIGHT)
f |= DT_RIGHT;
else
f |= DT_LEFT;
@@ -117,20 +117,22 @@ int ComputeFormatFlags(int flags, const std::wstring& text) {
} // anonymous namespace
ChromeCanvas::ChromeCanvas(int width, int height, bool is_opaque)
namespace gfx {
Canvas::Canvas(int width, int height, bool is_opaque)
: skia::PlatformCanvasWin(width, height, is_opaque) {
}
ChromeCanvas::ChromeCanvas() : skia::PlatformCanvasWin() {
Canvas::Canvas() : skia::PlatformCanvasWin() {
}
ChromeCanvas::~ChromeCanvas() {
Canvas::~Canvas() {
}
// static
void ChromeCanvas::SizeStringInt(const std::wstring& text,
const gfx::Font& font,
int *width, int *height, int flags) {
void Canvas::SizeStringInt(const std::wstring& text,
const gfx::Font& font,
int *width, int *height, int flags) {
HDC dc = GetDC(NULL);
HFONT old_font = static_cast<HFONT>(SelectObject(dc, font.hfont()));
RECT b;
@@ -153,9 +155,9 @@ void ChromeCanvas::SizeStringInt(const std::wstring& text,
ReleaseDC(NULL, dc);
}
void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font,
const SkColor& color, int x, int y, int w,
int h, int flags) {
void Canvas::DrawStringInt(const std::wstring& text, HFONT font,
const SkColor& color, int x, int y, int w, int h,
int flags) {
if (!IntersectsClipRectInt(x, y, w, h))
return;
@@ -181,10 +183,10 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text, HFONT font,
getTopPlatformDevice().makeOpaque(x, y, w, h);
}
void ChromeCanvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color,
int x, int y, int w, int h, int flags) {
void Canvas::DrawStringInt(const std::wstring& text,
const gfx::Font& font,
const SkColor& color,
int x, int y, int w, int h, int flags) {
DrawStringInt(text, font.hfont(), color, x, y, w, h, flags);
}
@@ -215,19 +217,19 @@ static bool pixelShouldGetHalo(const SkBitmap& bitmap, int x, int y,
return false;
}
void ChromeCanvas::DrawStringWithHalo(const std::wstring& text,
const gfx::Font& font,
const SkColor& text_color,
const SkColor& halo_color_in,
int x, int y, int w, int h,
int flags) {
void Canvas::DrawStringWithHalo(const std::wstring& text,
const gfx::Font& font,
const SkColor& text_color,
const SkColor& halo_color_in,
int x, int y, int w, int h,
int flags) {
// Some callers will have semitransparent halo colors, which we don't handle
// (since the resulting image can have 1-bit transparency only).
SkColor halo_color = halo_color_in | 0xFF000000;
// Create a temporary buffer filled with the halo color. It must leave room
// for the 1-pixel border around the text.
ChromeCanvas text_canvas(w + 2, h + 2, true);
Canvas text_canvas(w + 2, h + 2, true);
SkPaint bkgnd_paint;
bkgnd_paint.setColor(halo_color);
text_canvas.FillRectInt(0, 0, w + 2, h + 2, bkgnd_paint);
@@ -262,3 +264,5 @@ void ChromeCanvas::DrawStringWithHalo(const std::wstring& text,
// Draw the halo bitmap with blur.
drawBitmap(text_bitmap, SkIntToScalar(x - 1), SkIntToScalar(y - 1));
}
} // namespace gfx
+1 -1
Ver Arquivo
@@ -111,7 +111,7 @@ class Font {
// copied.
static Font CreateFont(HFONT hfont);
// Returns the handle to the underlying HFONT. This is used by ChromeCanvas to
// Returns the handle to the underlying HFONT. This is used by gfx::Canvas to
// draw text.
HFONT hfont() const { return font_ref_->hfont(); }
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include <fontconfig/fontconfig.h>
#include <gtk/gtk.h>
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include <Cocoa/Cocoa.h>
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/logging.h"
#include "base/sys_string_conversions.h"
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include <windows.h>
#include <math.h>
@@ -13,7 +13,6 @@
#include "base/logging.h"
#include "base/win_util.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
namespace gfx {
+3 -3
Ver Arquivo
@@ -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 CHROME_COMMON_ICON_UTIL_H__
#define CHROME_COMMON_ICON_UTIL_H__
#ifndef APP_ICON_UTIL_H_
#define APP_ICON_UTIL_H_
#include <windows.h>
#include <string>
@@ -190,4 +190,4 @@ class IconUtil {
DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil);
};
#endif // CHROME_COMMON_ICON_UTIL_H__
#endif // APP_ICON_UTIL_H_
+3 -3
Ver Arquivo
@@ -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 CHROME_COMMON_GFX_INSETS_H__
#define CHROME_COMMON_GFX_INSETS_H__
#ifndef APP_GFX_INSETS_H_
#define APP_GFX_INSETS_H_
namespace gfx {
@@ -66,4 +66,4 @@ class Insets {
} // namespace
#endif // CHROME_COMMON_GFX_INSETS_H__
#endif // APP_GFX_INSETS_H_
+3 -3
Ver Arquivo
@@ -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 CHROME_COMMON_GFX_CHROME_PATH_H_
#define CHROME_COMMON_GFX_CHROME_PATH_H_
#ifndef APP_GFX_PATH_H_
#define APP_GFX_PATH_H_
#include "base/basictypes.h"
@@ -37,4 +37,4 @@ class Path : public SkPath {
}
#endif // #ifndef CHROME_COMMON_GFX_CHROME_PATH_H_
#endif // #ifndef APP_GFX_PATH_H_
+1 -1
Ver Arquivo
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "base/file_path.h"
#include "base/string_util.h"
+4 -4
Ver Arquivo
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_GFX_TEXT_ELIDER_H_
#define CHROME_COMMON_GFX_TEXT_ELIDER_H_
#ifndef APP_GFX_TEXT_ELIDER_H_
#define APP_GFX_TEXT_ELIDER_H_
#include <unicode/coll.h>
#include <unicode/uchar.h>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/basictypes.h"
#include "base/string16.h"
@@ -96,4 +96,4 @@ class SortedDisplayURL {
} // namespace gfx.
#endif // CHROME_COMMON_GFX_TEXT_ELIDER_H_
#endif // APP_GFX_TEXT_ELIDER_H_
+1 -1
Ver Arquivo
@@ -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 "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "base/file_path.h"
#include "base/string_util.h"
+3 -3
Ver Arquivo
@@ -7,7 +7,7 @@
#include "app/l10n_util.h"
#include "app/app_switches.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -611,9 +611,9 @@ void WrapPathWithLTRFormatting(const FilePath& path,
int DefaultCanvasTextAlignment() {
if (GetTextDirection() == LEFT_TO_RIGHT) {
return ChromeCanvas::TEXT_ALIGN_LEFT;
return gfx::Canvas::TEXT_ALIGN_LEFT;
} else {
return ChromeCanvas::TEXT_ALIGN_RIGHT;
return gfx::Canvas::TEXT_ALIGN_RIGHT;
}
}
+4 -4
Ver Arquivo
@@ -188,12 +188,12 @@ void WrapPathWithLTRFormatting(const FilePath& path,
string16* rtl_safe_path);
// Returns the default text alignment to be used when drawing text on a
// ChromeCanvas based on the directionality of the system locale language. This
// function is used by ChromeCanvas::DrawStringInt when the text alignment is
// gfx::Canvas based on the directionality of the system locale language. This
// function is used by gfx::Canvas::DrawStringInt when the text alignment is
// not specified.
//
// This function returns either ChromeCanvas::TEXT_ALIGN_LEFT or
// ChromeCanvas::TEXT_ALIGN_RIGHT.
// This function returns either gfx::Canvas::TEXT_ALIGN_LEFT or
// gfx::Canvas::TEXT_ALIGN_RIGHT.
int DefaultCanvasTextAlignment();
// Compares the two strings using the specified collator.
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
#include "app/resource_bundle.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/gfx/png_decoder.h"
#include "base/logging.h"
#include "base/string_piece.h"
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#include <gtk/gtk.h>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/gfx/gtk_util.h"
#include "app/l10n_util.h"
#include "base/base_paths.h"
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/base_paths.h"
#include "base/data_pack.h"
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#include <atlbase.h>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "base/file_util.h"
#include "base/logging.h"
+1 -1
Ver Arquivo
@@ -10,7 +10,7 @@
#include <string>
#include <vector>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/fix_wp64.h"
#include "base/gfx/rect.h"
#include "base/scoped_handle.h"
@@ -6,7 +6,7 @@
#include <locale>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/os_exchange_data.h"
@@ -2009,7 +2009,7 @@ void AutocompleteEditViewWin::DrawSlashForInsecureScheme(
// Create a canvas as large as |scheme_rect| to do our drawing, and initialize
// it to fully transparent so any antialiasing will look nice when painted
// atop the edit.
ChromeCanvas canvas(scheme_rect.Width(), scheme_rect.Height(), false);
gfx::Canvas canvas(scheme_rect.Width(), scheme_rect.Height(), false);
// TODO (jcampan): This const_cast should not be necessary once the SKIA
// API has been changed to return a non-const bitmap.
(const_cast<SkBitmap&>(canvas.getDevice()->accessBitmap(true))).
@@ -12,7 +12,7 @@
#include <atlmisc.h>
#include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl.
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
@@ -8,7 +8,7 @@
#include <algorithm>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/resource_bundle.h"
#include "base/basictypes.h"
#include "base/gfx/gtk_util.h"
@@ -11,8 +11,8 @@
#include <atlmisc.h>
#include <cmath>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
@@ -670,7 +670,7 @@ void AutocompletePopupViewWin::DrawEntry(HDC dc,
}
void AutocompletePopupViewWin::DrawStar(HDC dc, int x, int y) const {
ChromeCanvas canvas(star_->width(), star_->height(), false);
gfx::Canvas canvas(star_->width(), star_->height(), false);
// Make the background completely transparent.
canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode);
canvas.DrawBitmapInt(*star_, 0, 0);
@@ -12,7 +12,7 @@
#include <string>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/scoped_ptr.h"
#include "base/win_util.h"
#include "chrome/browser/autocomplete/autocomplete.h"
+2 -2
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/debugger/debugger_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -57,7 +57,7 @@ void DebuggerView::ViewHierarchyChanged(bool is_add,
}
}
void DebuggerView::Paint(ChromeCanvas* canvas) {
void DebuggerView::Paint(gfx::Canvas* canvas) {
#ifndef NDEBUG
SkPaint paint;
canvas->FillRectInt(SK_ColorCYAN, x(), y(), width(), height());
+1 -1
Ver Arquivo
@@ -47,7 +47,7 @@ class DebuggerView : public views::View,
}
virtual gfx::Size GetPreferredSize();
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
+2 -2
Ver Arquivo
@@ -65,7 +65,7 @@ SkBitmap* g_background_16 = NULL;
SkBitmap* g_foreground_32 = NULL;
SkBitmap* g_background_32 = NULL;
void PaintDownloadProgress(ChromeCanvas* canvas,
void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
@@ -164,7 +164,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas,
foreground_paint);
}
void PaintDownloadComplete(ChromeCanvas* canvas,
void PaintDownloadComplete(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
+3 -3
Ver Arquivo
@@ -10,7 +10,7 @@
#include <set>
#include <string>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "base/basictypes.h"
#include "base/task.h"
@@ -97,7 +97,7 @@ enum PaintDownloadProgressSize {
// require the containing View in addition to the canvas because if we are
// drawing in a right-to-left locale, we need to mirror the position of the
// progress animation within the containing View.
void PaintDownloadProgress(ChromeCanvas* canvas,
void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
@@ -107,7 +107,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas,
int percent,
PaintDownloadProgressSize size);
void PaintDownloadComplete(ChromeCanvas* canvas,
void PaintDownloadComplete(gfx::Canvas* canvas,
#if defined(OS_WIN)
views::View* containing_view,
#endif
+2 -2
Ver Arquivo
@@ -68,7 +68,7 @@ ExtensionShelf::~ExtensionShelf() {
NotificationService::AllSources());
}
void ExtensionShelf::Paint(ChromeCanvas* canvas) {
void ExtensionShelf::Paint(gfx::Canvas* canvas) {
#if 0
// TODO(erikkay) re-enable this when Glen has the gradient values worked out.
SkPaint paint;
@@ -180,7 +180,7 @@ bool ExtensionShelf::HasExtensionViews() {
return GetChildViewCount() > 0;
}
void ExtensionShelf::InitBackground(ChromeCanvas* canvas,
void ExtensionShelf::InitBackground(gfx::Canvas* canvas,
const SkRect& subset) {
if (!background_.empty())
return;
+3 -3
Ver Arquivo
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SHELF_H_
#include "chrome/browser/extensions/extensions_service.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "chrome/common/notification_observer.h"
#include "views/view.h"
@@ -19,7 +19,7 @@ class ExtensionShelf : public views::View,
virtual ~ExtensionShelf();
// View
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual void Layout();
@@ -37,7 +37,7 @@ class ExtensionShelf : public views::View,
private:
// Inits the background bitmap.
void InitBackground(ChromeCanvas* canvas, const SkRect& subset);
void InitBackground(gfx::Canvas* canvas, const SkRect& subset);
Browser* browser_;
+3 -3
Ver Arquivo
@@ -4,8 +4,8 @@
#include "chrome/browser/gtk/download_item_gtk.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "app/slide_animation.h"
#include "base/basictypes.h"
@@ -402,7 +402,7 @@ gboolean DownloadItemGtk::OnExpose(GtkWidget* widget, GdkEventExpose* e,
gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget,
GdkEventExpose* event, DownloadItemGtk* download_item) {
// Create a transparent canvas.
ChromeCanvasPaint canvas(event, false);
gfx::CanvasPaint canvas(event, false);
if (download_item->complete_animation_.get()) {
if (download_item->complete_animation_->IsAnimating()) {
download_util::PaintDownloadComplete(&canvas,
+7 -7
Ver Arquivo
@@ -6,8 +6,8 @@
#include <string>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/gfx/size.h"
@@ -80,7 +80,7 @@ gboolean SadTabGtk::OnExposeThunk(GtkWidget* widget,
}
gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
ChromeCanvasPaint canvas(event);
gfx::CanvasPaint canvas(event);
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0, height_,
kBackgroundColor,
@@ -107,7 +107,7 @@ gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
title_y_,
width_,
sad_tab_constants.title_font.height(),
ChromeCanvas::TEXT_ALIGN_CENTER);
gfx::Canvas::TEXT_ALIGN_CENTER);
// Paint the explanatory message.
canvas.DrawStringInt(
@@ -118,9 +118,9 @@ gboolean SadTabGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) const {
message_y_,
width_,
99999, // Let the height be large, and we'll clip if needed.
ChromeCanvas::TEXT_ALIGN_CENTER |
ChromeCanvas::MULTI_LINE |
ChromeCanvas::TEXT_VALIGN_TOP);
gfx::Canvas::TEXT_ALIGN_CENTER |
gfx::Canvas::MULTI_LINE |
gfx::Canvas::TEXT_VALIGN_TOP);
return TRUE;
}
+5 -5
Ver Arquivo
@@ -284,7 +284,7 @@ void TabRendererGtk::AnimationEnded(const Animation* animation) {
// TabRendererGtk, private:
void TabRendererGtk::Paint(GdkEventExpose* event) {
ChromeCanvasPaint canvas(event, false);
gfx::CanvasPaint canvas(event, false);
if (canvas.isEmpty())
return;
@@ -406,7 +406,7 @@ void TabRendererGtk::Layout() {
// TODO(jhawkins): Handle RTL layout.
}
void TabRendererGtk::PaintTabBackground(ChromeCanvasPaint* canvas) {
void TabRendererGtk::PaintTabBackground(gfx::CanvasPaint* canvas) {
if (IsSelected()) {
// Sometimes detaching a tab quickly can result in the model reporting it
// as not being selected, so is_drag_clone_ ensures that we always paint
@@ -435,7 +435,7 @@ void TabRendererGtk::PaintTabBackground(ChromeCanvasPaint* canvas) {
}
}
void TabRendererGtk::PaintInactiveTabBackground(ChromeCanvasPaint* canvas) {
void TabRendererGtk::PaintInactiveTabBackground(gfx::CanvasPaint* canvas) {
bool is_otr = data_.off_the_record;
// The tab image needs to be lined up with the background image
@@ -486,7 +486,7 @@ void TabRendererGtk::PaintInactiveTabBackground(ChromeCanvasPaint* canvas) {
bounds_.x() + width() - tab_inactive_.r_width, bounds_.y());
}
void TabRendererGtk::PaintActiveTabBackground(ChromeCanvasPaint* canvas) {
void TabRendererGtk::PaintActiveTabBackground(gfx::CanvasPaint* canvas) {
int offset = 1;
SkBitmap* tab_bg = theme_provider_->GetBitmapNamed(IDR_THEME_TOOLBAR);
@@ -522,7 +522,7 @@ void TabRendererGtk::PaintActiveTabBackground(ChromeCanvasPaint* canvas) {
bounds_.x() + width() - tab_active_.r_width, bounds_.y());
}
void TabRendererGtk::PaintLoadingAnimation(ChromeCanvasPaint* canvas) {
void TabRendererGtk::PaintLoadingAnimation(gfx::CanvasPaint* canvas) {
const SkBitmap* frames =
(loading_animation_.animation_state() == ANIMATION_WAITING) ?
loading_animation_.waiting_animation_frames() :
+6 -6
Ver Arquivo
@@ -8,8 +8,8 @@
#include <gtk/gtk.h>
#include "app/animation.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/slide_animation.h"
#include "base/basictypes.h"
#include "base/gfx/rect.h"
@@ -171,10 +171,10 @@ class TabRendererGtk : public AnimationDelegate {
static int GetContentHeight();
// Paint various portions of the Tab
void PaintTabBackground(ChromeCanvasPaint* canvas);
void PaintInactiveTabBackground(ChromeCanvasPaint* canvas);
void PaintActiveTabBackground(ChromeCanvasPaint* canvas);
void PaintLoadingAnimation(ChromeCanvasPaint* canvas);
void PaintTabBackground(gfx::CanvasPaint* canvas);
void PaintInactiveTabBackground(gfx::CanvasPaint* canvas);
void PaintActiveTabBackground(gfx::CanvasPaint* canvas);
void PaintLoadingAnimation(gfx::CanvasPaint* canvas);
// Returns the number of favicon-size elements that can fit in the tab's
// current size.
+2 -2
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
@@ -1060,7 +1060,7 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) {
}
void TabStripGtk::PaintBackground(GdkEventExpose* event) {
ChromeCanvasPaint canvas(event);
gfx::CanvasPaint canvas(event);
canvas.TileImageInt(*background, 0, 0, bounds_.width(), bounds_.height());
}
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#include <set>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/gfx/text_elider.h"
#include "app/win_util.h"
#include "base/message_loop.h"
@@ -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 "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "base/basictypes.h"
#include "base/keyboard_codes.h"
#include "base/scoped_ptr.h"
@@ -253,7 +253,7 @@ TEST_F(RenderWidgetHostTest, Background) {
host_->set_view(view.get());
// Create a checkerboard background to test with.
ChromeCanvas canvas(4, 4, true);
gfx::Canvas canvas(4, 4, true);
canvas.FillRectInt(SK_ColorBLACK, 0, 0, 2, 2);
canvas.FillRectInt(SK_ColorWHITE, 2, 0, 2, 2);
canvas.FillRectInt(SK_ColorWHITE, 0, 2, 2, 2);
@@ -288,7 +288,7 @@ TEST_F(RenderWidgetHostTest, Background) {
#endif
#else
// TODO(port): Mac does not have ChromeCanvas. Maybe we can just change this
// TODO(port): Mac does not have gfx::Canvas. Maybe we can just change this
// test to use SkCanvas directly?
#endif
@@ -4,7 +4,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/resource_bundle.h"
@@ -549,7 +549,7 @@ void RenderWidgetHostViewWin::DrawResizeCorner(const gfx::Rect& paint_rect,
if (!paint_rect.Intersect(resize_corner_rect).IsEmpty()) {
SkBitmap* bitmap = ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_TEXTAREA_RESIZER);
ChromeCanvas canvas(bitmap->width(), bitmap->height(), false);
gfx::Canvas canvas(bitmap->width(), bitmap->height(), false);
// TODO(jcampan): This const_cast should not be necessary once the
// SKIA API has been changed to return a non-const bitmap.
const_cast<SkBitmap&>(canvas.getDevice()->accessBitmap(true)).
@@ -757,9 +757,9 @@ void RenderWidgetHostViewWin::OnPaint(HDC dc) {
void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
CPaintDC* dc) {
if (!background_.empty()) {
ChromeCanvas canvas(dirty_rect.right - dirty_rect.left,
dirty_rect.bottom - dirty_rect.top,
true); // opaque
gfx::Canvas canvas(dirty_rect.right - dirty_rect.left,
dirty_rect.bottom - dirty_rect.top,
true); // opaque
canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top);
const RECT& dc_rect = dc->m_ps.rcPaint;
@@ -6,7 +6,7 @@
#include <windows.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/os_exchange_data.h"
#include "chrome/browser/bookmarks/bookmark_drag_data.h"
#include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
@@ -443,7 +443,7 @@ void TabContentsViewWin::OnPaint(HDC junk_dc) {
CRect cr;
GetClientRect(&cr);
sad_tab_->SetBounds(gfx::Rect(cr));
ChromeCanvasPaint canvas(GetNativeView(), true);
gfx::CanvasPaint canvas(GetNativeView(), true);
sad_tab_->ProcessPaint(&canvas);
return;
}
+8 -8
Ver Arquivo
@@ -6,7 +6,7 @@
#include <commdlg.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -351,7 +351,7 @@ void AboutChromeView::Layout() {
}
void AboutChromeView::Paint(ChromeCanvas* canvas) {
void AboutChromeView::Paint(gfx::Canvas* canvas) {
views::View::Paint(canvas);
// Draw the background image color (and the separator) across the dialog.
@@ -424,7 +424,7 @@ void AboutChromeView::Paint(ChromeCanvas* canvas) {
main_text_label_height_ = position.height() + font.height();
}
void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas,
void AboutChromeView::DrawTextAndPositionUrl(gfx::Canvas* canvas,
const std::wstring& text,
views::Link* link,
gfx::Rect* rect,
@@ -479,7 +479,7 @@ void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas,
}
}
void AboutChromeView::DrawTextStartingFrom(ChromeCanvas* canvas,
void AboutChromeView::DrawTextStartingFrom(gfx::Canvas* canvas,
const std::wstring& text,
gfx::Size* position,
const gfx::Rect& bounds,
@@ -492,10 +492,10 @@ void AboutChromeView::DrawTextStartingFrom(ChromeCanvas* canvas,
return;
int flags = (text_direction_is_rtl_ ?
ChromeCanvas::TEXT_ALIGN_RIGHT :
ChromeCanvas::TEXT_ALIGN_LEFT) |
ChromeCanvas::MULTI_LINE |
ChromeCanvas::HIDE_PREFIX;
gfx::Canvas::TEXT_ALIGN_RIGHT :
gfx::Canvas::TEXT_ALIGN_LEFT) |
gfx::Canvas::MULTI_LINE |
gfx::Canvas::HIDE_PREFIX;
// Iterate over each word in the text, or put in a more locale-neutral way:
// iterate to the next line breaking opportunity.
+3 -3
Ver Arquivo
@@ -41,7 +41,7 @@ class AboutChromeView : public views::View,
// Overridden from views::View:
virtual gfx::Size GetPreferredSize();
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
@@ -93,7 +93,7 @@ class AboutChromeView : public views::View,
// NOTE: The reason why we need this function is because while Skia knows how
// to wrap text appropriately, it doesn't tell us where it drew the last
// character, which we need to position the URLs within the text.
void DrawTextAndPositionUrl(ChromeCanvas* canvas,
void DrawTextAndPositionUrl(gfx::Canvas* canvas,
const std::wstring& text,
views::Link* link,
gfx::Rect* rect,
@@ -106,7 +106,7 @@ class AboutChromeView : public views::View,
// |word_for_word| specifies whether to draw the text word for word or wheter
// to treat the text as one blurb (similar to the way url's are treated inside
// RTL text. For details on the other parameters, see DrawTextAndPositionUrl.
void DrawTextStartingFrom(ChromeCanvas* canvas,
void DrawTextStartingFrom(gfx::Canvas* canvas,
const std::wstring& text,
gfx::Size* position,
const gfx::Rect& bounds,
@@ -8,7 +8,7 @@
#include <commctrl.h>
#include <dwmapi.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "app/gfx/insets.h"
#include "app/gfx/path.h"
@@ -71,7 +71,7 @@ class AutocompleteResultView : public views::View {
virtual ~AutocompleteResultView();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
virtual void OnMouseEntered(const views::MouseEvent& event);
@@ -92,16 +92,16 @@ class AutocompleteResultView : public views::View {
// |classifications|. If |force_dim| is true, ACMatchClassification::DIM is
// added to all of the classifications. Returns the x position to the right
// of the string.
int DrawString(ChromeCanvas* canvas,
const std::wstring& text,
const ACMatchClassifications& classifications,
bool force_dim,
int x,
int y);
int DrawString(gfx::Canvas* canvas,
const std::wstring& text,
const ACMatchClassifications& classifications,
bool force_dim,
int x,
int y);
// Draws an individual sub-fragment with the specified style. Returns the x
// position to the right of the fragment.
int DrawStringFragment(ChromeCanvas* canvas,
int DrawStringFragment(gfx::Canvas* canvas,
const std::wstring& text,
int style,
int x,
@@ -284,7 +284,7 @@ AutocompleteResultView::AutocompleteResultView(
AutocompleteResultView::~AutocompleteResultView() {
}
void AutocompleteResultView::Paint(ChromeCanvas* canvas) {
void AutocompleteResultView::Paint(gfx::Canvas* canvas) {
canvas->FillRectInt(GetBackgroundColor(), 0, 0, width(), height());
int x = MirroredLeftPointForRect(icon_bounds_);
@@ -421,7 +421,7 @@ SkBitmap* AutocompleteResultView::GetIcon() const {
}
int AutocompleteResultView::DrawString(
ChromeCanvas* canvas,
gfx::Canvas* canvas,
const std::wstring& text,
const ACMatchClassifications& classifications,
bool force_dim,
@@ -494,7 +494,7 @@ int AutocompleteResultView::DrawString(
}
int AutocompleteResultView::DrawStringFragment(
ChromeCanvas* canvas,
gfx::Canvas* canvas,
const std::wstring& text,
int style,
int x,
@@ -563,7 +563,7 @@ class PopupBorder : public views::Border {
}
// Overridden from views::Border:
virtual void Paint(const views::View& view, ChromeCanvas* canvas) const;
virtual void Paint(const views::View& view, gfx::Canvas* canvas) const;
virtual void GetInsets(gfx::Insets* insets) const;
private:
@@ -592,7 +592,7 @@ SkBitmap* PopupBorder::dropshadow_bottomright_ = NULL;
SkBitmap* PopupBorder::dropshadow_bottom_ = NULL;
SkBitmap* PopupBorder::dropshadow_bottomleft_ = NULL;
void PopupBorder::Paint(const views::View& view, ChromeCanvas* canvas) const {
void PopupBorder::Paint(const views::View& view, gfx::Canvas* canvas) const {
int ds_tl_width = dropshadow_topleft_->width();
int ds_tl_height = dropshadow_topleft_->height();
int ds_tr_width = dropshadow_topright_->width();
@@ -767,7 +767,7 @@ void AutocompletePopupContentsView::SetSelectedLine(size_t index,
////////////////////////////////////////////////////////////////////////////////
// AutocompletePopupContentsView, views::View overrides:
void AutocompletePopupContentsView::PaintChildren(ChromeCanvas* canvas) {
void AutocompletePopupContentsView::PaintChildren(gfx::Canvas* canvas) {
// We paint our children in an unconventional way.
//
// Because the border of this view creates an anti-aliased round-rect region
@@ -778,7 +778,7 @@ void AutocompletePopupContentsView::PaintChildren(ChromeCanvas* canvas) {
// Instead, we paint all our children into a second canvas and use that as a
// shader to fill a path representing the round-rect clipping region. This
// yields a nice anti-aliased edge.
ChromeCanvas contents_canvas(width(), height(), true);
gfx::Canvas contents_canvas(width(), height(), true);
contents_canvas.FillRectInt(kBackgroundColor, 0, 0, width(), height());
View::PaintChildren(&contents_canvas);
// We want the contents background to be slightly transparent so we can see
@@ -865,7 +865,7 @@ void AutocompletePopupContentsView::UpdateBlurRegion() {
}
void AutocompletePopupContentsView::MakeCanvasTransparent(
ChromeCanvas* canvas) {
gfx::Canvas* canvas) {
// Allow the window blur effect to show through the popup background.
SkPaint paint;
SkColor transparency = win_util::ShouldUseVistaFrame() ?
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
#define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
@@ -77,7 +77,7 @@ class AutocompletePopupContentsView : public views::View,
virtual void SetSelectedLine(size_t index, bool revert_to_default);
// Overridden from views::View:
virtual void PaintChildren(ChromeCanvas* canvas);
virtual void PaintChildren(gfx::Canvas* canvas);
virtual void Layout();
private:
@@ -89,7 +89,7 @@ class AutocompletePopupContentsView : public views::View,
void UpdateBlurRegion();
// Makes the contents of the canvas slightly transparent.
void MakeCanvasTransparent(ChromeCanvas* canvas);
void MakeCanvasTransparent(gfx::Canvas* canvas);
// The popup that contains this view.
AutocompletePopupWin* popup_;
+2 -2
Ver Arquivo
@@ -12,7 +12,7 @@
#include <math.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -125,7 +125,7 @@ void BlockedPopupContainerView::UpdateLabel() {
SchedulePaint();
}
void BlockedPopupContainerView::Paint(ChromeCanvas* canvas) {
void BlockedPopupContainerView::Paint(gfx::Canvas* canvas) {
// Draw the standard background.
View::Paint(canvas);
+1 -1
Ver Arquivo
@@ -52,7 +52,7 @@ class BlockedPopupContainerView : public views::View,
// Overridden from views::View:
// Paints our border and background. (Does not paint children.)
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
// Sets positions of all child views.
virtual void Layout();
// Gets the desired size of the popup notification.
+7 -7
Ver Arquivo
@@ -6,7 +6,7 @@
#include <limits>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
@@ -256,7 +256,7 @@ class BookmarkFolderButton : public views::MenuButton {
return e.IsMiddleMouseButton();
}
virtual void Paint(ChromeCanvas *canvas) {
virtual void Paint(gfx::Canvas *canvas) {
views::MenuButton::Paint(canvas, false);
}
@@ -310,7 +310,7 @@ class ButtonSeparatorView : public views::View {
ButtonSeparatorView() {}
virtual ~ButtonSeparatorView() {}
virtual void Paint(ChromeCanvas* canvas) {
virtual void Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0,
height() / 2,
@@ -554,7 +554,7 @@ void BookmarkBarView::ViewHierarchyChanged(bool is_add,
}
}
void BookmarkBarView::Paint(ChromeCanvas* canvas) {
void BookmarkBarView::Paint(gfx::Canvas* canvas) {
if (IsDetachedStyle()) {
// Draw the background to match the new tab page.
canvas->FillRectInt(kNewtabBackgroundColor, 0, 0, width(), height());
@@ -616,7 +616,7 @@ void BookmarkBarView::Paint(ChromeCanvas* canvas) {
}
}
void BookmarkBarView::PaintChildren(ChromeCanvas* canvas) {
void BookmarkBarView::PaintChildren(gfx::Canvas* canvas) {
View::PaintChildren(canvas);
if (drop_info_.get() && drop_info_->valid &&
@@ -892,7 +892,7 @@ MenuButton* BookmarkBarView::CreateOverflowButton() {
// right-to-left.
//
// By default, menu buttons are not flipped because they generally contain
// text and flipping the ChromeCanvas object will break text rendering. Since
// text and flipping the gfx::Canvas object will break text rendering. Since
// the overflow button does not contain text, we can safely flip it.
button->EnableCanvasFlippingForRTLUI(true);
@@ -1053,7 +1053,7 @@ void BookmarkBarView::WriteDragData(View* sender,
for (int i = 0; i < GetBookmarkButtonCount(); ++i) {
if (sender == GetBookmarkButton(i)) {
views::TextButton* button = GetBookmarkButton(i);
ChromeCanvas canvas(button->width(), button->height(), false);
gfx::Canvas canvas(button->width(), button->height(), false);
button->Paint(&canvas, true);
drag_utils::SetDragImageOnDataObject(canvas, button->width(),
button->height(), press_x,
+2 -2
Ver Arquivo
@@ -96,8 +96,8 @@ class BookmarkBarView : public views::View,
virtual void DidChangeBounds(const gfx::Rect& previous,
const gfx::Rect& current);
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
virtual void Paint(ChromeCanvas* canvas);
virtual void PaintChildren(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void PaintChildren(gfx::Canvas* canvas);
virtual bool CanDrop(const OSExchangeData& data);
virtual void OnDragEntered(const views::DropTargetEvent& event);
virtual int OnDragUpdated(const views::DropTargetEvent& event);
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/bookmark_bubble_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "chrome/app/chrome_dll_resource.h"
+2 -2
Ver Arquivo
@@ -6,7 +6,7 @@
#include <algorithm>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "base/thread.h"
#include "chrome/browser/bookmarks/bookmark_folder_tree_model.h"
@@ -302,7 +302,7 @@ std::vector<BookmarkNode*> BookmarkManagerView::GetSelectedTableNodes() {
return nodes;
}
void BookmarkManagerView::PaintBackground(ChromeCanvas* canvas) {
void BookmarkManagerView::PaintBackground(gfx::Canvas* canvas) {
canvas->drawColor(kBackgroundColorBottom, SkPorterDuff::kSrc_Mode);
SkPaint paint;
+1 -1
Ver Arquivo
@@ -76,7 +76,7 @@ class BookmarkManagerView : public views::View,
// Returns the selection of the table.
std::vector<BookmarkNode*> GetSelectedTableNodes();
virtual void PaintBackground(ChromeCanvas* canvas);
virtual void PaintBackground(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
+3 -3
Ver Arquivo
@@ -7,8 +7,8 @@
#include <commctrl.h>
#include "app/drag_drop_types.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
#include "base/base_drag_source.h"
@@ -420,7 +420,7 @@ void BookmarkTableView::PaintAltText() {
HDC dc = GetDC(GetNativeControlHWND());
gfx::Font font = GetAltTextFont();
gfx::Rect bounds = GetAltTextBounds();
ChromeCanvas canvas(bounds.width(), bounds.height(), false);
gfx::Canvas canvas(bounds.width(), bounds.height(), false);
// Pad by 1 for halo.
canvas.DrawStringWithHalo(alt_text_, font, SK_ColorDKGRAY, SK_ColorWHITE, 1,
1, bounds.width() - 2, bounds.height() - 2,
+10 -10
Ver Arquivo
@@ -4,8 +4,8 @@
#include "chrome/browser/views/constrained_window_impl.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/gfx/path.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
@@ -177,7 +177,7 @@ class ConstrainedWindowFrameView
virtual void ResetWindowControls() { }
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual void ThemeChanged();
@@ -203,9 +203,9 @@ class ConstrainedWindowFrameView
int* title_thickness) const;
// Paints different parts of the window to the incoming canvas.
void PaintFrameBorder(ChromeCanvas* canvas);
void PaintTitleBar(ChromeCanvas* canvas);
void PaintClientEdge(ChromeCanvas* canvas);
void PaintFrameBorder(gfx::Canvas* canvas);
void PaintTitleBar(gfx::Canvas* canvas);
void PaintClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutWindowControls();
@@ -381,7 +381,7 @@ void ConstrainedWindowFrameView::EnableClose(bool enable) {
////////////////////////////////////////////////////////////////////////////////
// ConstrainedWindowFrameView, views::View implementation:
void ConstrainedWindowFrameView::Paint(ChromeCanvas* canvas) {
void ConstrainedWindowFrameView::Paint(gfx::Canvas* canvas) {
PaintFrameBorder(canvas);
PaintTitleBar(canvas);
PaintClientEdge(canvas);
@@ -435,7 +435,7 @@ int ConstrainedWindowFrameView::TitleCoordinates(
return *title_top_spacing + *title_thickness + title_bottom_spacing;
}
void ConstrainedWindowFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
void ConstrainedWindowFrameView::PaintFrameBorder(gfx::Canvas* canvas) {
SkBitmap* top_left_corner = resources_->GetPartBitmap(FRAME_TOP_LEFT_CORNER);
SkBitmap* top_right_corner =
resources_->GetPartBitmap(FRAME_TOP_RIGHT_CORNER);
@@ -502,13 +502,13 @@ void ConstrainedWindowFrameView::PaintFrameBorder(ChromeCanvas* canvas) {
height() - top_left_corner->height() - bottom_left_corner->height());
}
void ConstrainedWindowFrameView::PaintTitleBar(ChromeCanvas* canvas) {
void ConstrainedWindowFrameView::PaintTitleBar(gfx::Canvas* canvas) {
canvas->DrawStringInt(container_->GetWindowTitle(), *title_font_,
GetTitleColor(), MirroredLeftPointForRect(title_bounds_),
title_bounds_.y(), title_bounds_.width(), title_bounds_.height());
}
void ConstrainedWindowFrameView::PaintClientEdge(ChromeCanvas* canvas) {
void ConstrainedWindowFrameView::PaintClientEdge(gfx::Canvas* canvas) {
gfx::Rect client_edge_bounds(CalculateClientAreaBounds(width(), height()));
client_edge_bounds.Inset(-kClientEdgeThickness, -kClientEdgeThickness);
gfx::Rect frame_shadow_bounds(client_edge_bounds);
+3 -3
Ver Arquivo
@@ -6,7 +6,7 @@
#include <vector>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -429,7 +429,7 @@ void DownloadItemView::ButtonPressed(views::Button* sender) {
// Load an icon for the file type we're downloading, and animate any in progress
// download state.
void DownloadItemView::Paint(ChromeCanvas* canvas) {
void DownloadItemView::Paint(gfx::Canvas* canvas) {
BodyImageSet* body_image_set;
switch (body_state_) {
case NORMAL:
@@ -624,7 +624,7 @@ void DownloadItemView::Paint(ChromeCanvas* canvas) {
}
}
void DownloadItemView::PaintBitmaps(ChromeCanvas* canvas,
void DownloadItemView::PaintBitmaps(gfx::Canvas* canvas,
const SkBitmap* top_bitmap,
const SkBitmap* center_bitmap,
const SkBitmap* bottom_bitmap,
+3 -3
Ver Arquivo
@@ -18,7 +18,7 @@
#include <string>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/slide_animation.h"
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
@@ -55,7 +55,7 @@ class DownloadItemView : public views::ButtonListener,
// View overrides
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual void OnMouseExited(const views::MouseEvent& event);
virtual void OnMouseMoved(const views::MouseEvent& event);
@@ -111,7 +111,7 @@ class DownloadItemView : public views::ButtonListener,
// Convenience method to paint the 3 vertical bitmaps (bottom, middle, top)
// that form the background.
void PaintBitmaps(ChromeCanvas* canvas,
void PaintBitmaps(gfx::Canvas* canvas,
const SkBitmap* top_bitmap,
const SkBitmap* center_bitmap,
const SkBitmap* bottom_bitmap,
+3 -3
Ver Arquivo
@@ -6,7 +6,7 @@
#include <algorithm>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/logging.h"
@@ -147,12 +147,12 @@ void DownloadShelfView::RemoveDownloadView(View* view) {
SchedulePaint();
}
void DownloadShelfView::Paint(ChromeCanvas* canvas) {
void DownloadShelfView::Paint(gfx::Canvas* canvas) {
PaintBackground(canvas);
PaintBorder(canvas);
}
void DownloadShelfView::PaintBorder(ChromeCanvas* canvas) {
void DownloadShelfView::PaintBorder(gfx::Canvas* canvas) {
canvas->FillRectInt(kBorderColor, 0, 0, width(), 1);
}
+2 -2
Ver Arquivo
@@ -38,7 +38,7 @@ class DownloadShelfView : public DownloadShelf,
// Implementation of View.
virtual gfx::Size GetPreferredSize();
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
// Implementation of AnimationDelegate.
virtual void AnimationProgressed(const Animation* animation);
@@ -70,7 +70,7 @@ class DownloadShelfView : public DownloadShelf,
void AddDownloadView(views::View* view);
// Paints the border.
void PaintBorder(ChromeCanvas* canvas);
void PaintBorder(gfx::Canvas* canvas);
// The animation for adding new items to the shelf.
scoped_ptr<SlideAnimation> new_item_animation_;
+2 -2
Ver Arquivo
@@ -6,7 +6,7 @@
#include <algorithm>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_util.h"
@@ -237,7 +237,7 @@ void FindBarView::SetFocusAndSelection() {
///////////////////////////////////////////////////////////////////////////////
// FindBarView, views::View overrides:
void FindBarView::Paint(ChromeCanvas* canvas) {
void FindBarView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
// Get the local bounds so that we now how much to stretch the background.
+1 -1
Ver Arquivo
@@ -56,7 +56,7 @@ class FindBarView : public views::View,
void animation_offset(int offset) { animation_offset_ = offset; }
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child);
+2 -2
Ver Arquivo
@@ -5,7 +5,7 @@
#include "chrome/browser/views/frame/browser_view.h"
#include "app/drag_drop_types.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
@@ -138,7 +138,7 @@ class ResizeCorner : public views::View {
public:
ResizeCorner() { }
virtual void Paint(ChromeCanvas* canvas) {
virtual void Paint(gfx::Canvas* canvas) {
views::WindowWin* window = GetWindow();
if (!window || (window->IsMaximized() || window->IsFullscreen()))
return;
@@ -4,7 +4,7 @@
#include "chrome/browser/views/frame/glass_browser_frame_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
#include "chrome/browser/browser_theme_provider.h"
@@ -176,7 +176,7 @@ int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) {
///////////////////////////////////////////////////////////////////////////////
// GlassBrowserFrameView, views::View overrides:
void GlassBrowserFrameView::Paint(ChromeCanvas* canvas) {
void GlassBrowserFrameView::Paint(gfx::Canvas* canvas) {
if (!browser_view_->IsTabStripVisible())
return; // Nothing is visible, so don't bother to paint.
@@ -216,7 +216,7 @@ int GlassBrowserFrameView::NonClientTopBorderHeight() const {
(browser_view_->IsMaximized() ? 0 : kNonClientRestoredExtraThickness);
}
void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
void GlassBrowserFrameView::PaintDistributorLogo(gfx::Canvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
if (!frame_->IsMaximized() && distributor_logo_ &&
@@ -229,7 +229,7 @@ void GlassBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
}
}
void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds());
@@ -261,7 +261,7 @@ void GlassBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
toolbar_bounds.right(), toolbar_bounds.y());
}
void GlassBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
void GlassBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) {
if (!browser_view_->ShouldShowOffTheRecordAvatar())
return;
@@ -273,7 +273,7 @@ void GlassBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false);
}
void GlassBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
void GlassBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
// The client edges start below the toolbar upper corner images regardless
@@ -34,7 +34,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView {
protected:
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
private:
@@ -51,10 +51,10 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView {
int NonClientTopBorderHeight() const;
// Paint various sub-components of this view.
void PaintDistributorLogo(ChromeCanvas* canvas);
void PaintToolbarBackground(ChromeCanvas* canvas);
void PaintOTRAvatar(ChromeCanvas* canvas);
void PaintRestoredClientEdge(ChromeCanvas* canvas);
void PaintDistributorLogo(gfx::Canvas* canvas);
void PaintToolbarBackground(gfx::Canvas* canvas);
void PaintOTRAvatar(gfx::Canvas* canvas);
void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutDistributorLogo();
@@ -4,8 +4,8 @@
#include "chrome/browser/views/frame/opaque_browser_frame_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -313,7 +313,7 @@ void OpaqueBrowserFrameView::ResetWindowControls() {
///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameView, views::View overrides:
void OpaqueBrowserFrameView::Paint(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::Paint(gfx::Canvas* canvas) {
if (frame_->IsFullscreen())
return; // Nothing is visible, so don't bother to paint.
@@ -506,7 +506,7 @@ int OpaqueBrowserFrameView::IconSize(int* title_top_spacing_ptr,
kIconHeightFractionDenominator) / 2 * 2, kIconMinimumSize);
}
void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
SkBitmap* top_left_corner = tp->GetBitmapNamed(IDR_WINDOW_TOP_LEFT_CORNER);
@@ -603,7 +603,7 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(ChromeCanvas* canvas) {
}
void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
// Window frame mode and color
SkBitmap* theme_frame;
@@ -632,7 +632,7 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(ChromeCanvas* canvas) {
}
}
void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintDistributorLogo(gfx::Canvas* canvas) {
// The distributor logo is only painted when the frame is not maximized and
// when we actually have a logo.
if (!frame_->IsMaximized() && distributor_logo_ &&
@@ -642,7 +642,7 @@ void OpaqueBrowserFrameView::PaintDistributorLogo(ChromeCanvas* canvas) {
}
}
void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintTitleBar(gfx::Canvas* canvas) {
// The window icon is painted by the TabIconView.
views::WindowDelegate* d = frame_->GetDelegate();
if (d->ShouldShowWindowTitle()) {
@@ -658,7 +658,7 @@ void OpaqueBrowserFrameView::PaintTitleBar(ChromeCanvas* canvas) {
}
}
void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
if (!browser_view_->IsToolbarVisible())
return;
@@ -716,7 +716,7 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(ChromeCanvas* canvas) {
toolbar_right->width(), bottom_edge_height, false);
}
void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) {
if (!browser_view_->ShouldShowOffTheRecordAvatar())
return;
@@ -728,7 +728,7 @@ void OpaqueBrowserFrameView::PaintOTRAvatar(ChromeCanvas* canvas) {
otr_avatar_bounds_.width(), otr_avatar_bounds_.height(), false);
}
void OpaqueBrowserFrameView::PaintRestoredClientEdge(ChromeCanvas* canvas) {
void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
ThemeProvider* tp = GetThemeProvider();
int client_area_top = frame_->GetClientView()->y();
@@ -47,7 +47,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
virtual void ResetWindowControls();
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual bool HitTest(const gfx::Point& l) const;
virtual void ViewHierarchyChanged(bool is_add,
@@ -101,13 +101,13 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
// Paint various sub-components of this view. The *FrameBorder() functions
// also paint the background of the titlebar area, since the top frame border
// and titlebar background are a contiguous component.
void PaintRestoredFrameBorder(ChromeCanvas* canvas);
void PaintMaximizedFrameBorder(ChromeCanvas* canvas);
void PaintDistributorLogo(ChromeCanvas* canvas);
void PaintTitleBar(ChromeCanvas* canvas);
void PaintToolbarBackground(ChromeCanvas* canvas);
void PaintOTRAvatar(ChromeCanvas* canvas);
void PaintRestoredClientEdge(ChromeCanvas* canvas);
void PaintRestoredFrameBorder(gfx::Canvas* canvas);
void PaintMaximizedFrameBorder(gfx::Canvas* canvas);
void PaintDistributorLogo(gfx::Canvas* canvas);
void PaintTitleBar(gfx::Canvas* canvas);
void PaintToolbarBackground(gfx::Canvas* canvas);
void PaintOTRAvatar(gfx::Canvas* canvas);
void PaintRestoredClientEdge(gfx::Canvas* canvas);
// Layout various sub-components of this view.
void LayoutWindowControls();
+3 -3
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/fullscreen_exit_bubble.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
#include "app/resource_bundle.h"
@@ -29,7 +29,7 @@ class FullscreenExitBubble::FullscreenExitView : public views::View {
// views::View
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
// Handle to the HWND that contains us.
views::WidgetWin* popup_;
@@ -71,7 +71,7 @@ void FullscreenExitBubble::FullscreenExitView::Layout() {
link_preferred_size.width(), link_preferred_size.height());
}
void FullscreenExitBubble::FullscreenExitView::Paint(ChromeCanvas* canvas) {
void FullscreenExitBubble::FullscreenExitView::Paint(gfx::Canvas* canvas) {
// Create a round-bottomed rect to fill the whole View.
CRect parent_rect;
SkRect rect;
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/hung_renderer_dialog.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/renderer_host/render_process_host.h"
+2 -2
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/info_bubble.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/resource_bundle.h"
#include "app/win_util.h"
@@ -338,7 +338,7 @@ HRGN InfoBubble::ContentView::GetMask(const CSize &size) {
return mask.CreateHRGN();
}
void InfoBubble::ContentView::Paint(ChromeCanvas* canvas) {
void InfoBubble::ContentView::Paint(gfx::Canvas* canvas) {
int bubble_x = 0;
int bubble_y = 0;
int bubble_w = width();
+1 -1
Ver Arquivo
@@ -121,7 +121,7 @@ class InfoBubble : public views::WidgetWin,
HRGN GetMask(const CSize& size);
// Paints the background and arrow appropriately.
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
// Returns true if the arrow is positioned along the top edge of the
// view. If this returns false the arrow is positioned along the bottom
+2 -2
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/infobars/infobars.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
@@ -64,7 +64,7 @@ class InfoBarBackground : public views::Background {
}
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas, views::View* view) const {
virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
// First paint the gradient background.
gradient_background_->Paint(canvas, view);
+4 -4
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/location_bar_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/win_util.h"
@@ -223,7 +223,7 @@ void LocationBarView::Layout() {
DoLayout(true);
}
void LocationBarView::Paint(ChromeCanvas* canvas) {
void LocationBarView::Paint(gfx::Canvas* canvas) {
View::Paint(canvas);
SkColor bg = SkColorSetRGB(
@@ -677,7 +677,7 @@ void LocationBarView::SelectedKeywordView::SetFont(const gfx::Font& font) {
partial_label_.SetFont(font);
}
void LocationBarView::SelectedKeywordView::Paint(ChromeCanvas* canvas) {
void LocationBarView::SelectedKeywordView::Paint(gfx::Canvas* canvas) {
canvas->TranslateInt(0, kBackgroundYOffset);
background_painter_.Paint(width(), height() - kTopInset, canvas);
canvas->TranslateInt(0, -kBackgroundYOffset);
@@ -795,7 +795,7 @@ void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) {
}
}
void LocationBarView::KeywordHintView::Paint(ChromeCanvas* canvas) {
void LocationBarView::KeywordHintView::Paint(gfx::Canvas* canvas) {
int image_x = leading_label_.IsVisible() ? leading_label_.width() : 0;
// Since we paint the button image directly on the canvas (instead of using a
+5 -5
Ver Arquivo
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/gfx/rect.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view_win.h"
@@ -78,10 +78,10 @@ class LocationBarView : public LocationBar,
// Layout and Painting functions
virtual void Layout();
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
// No focus border for the location bar, the caret is enough.
virtual void PaintFocusBorder(ChromeCanvas* canvas) { }
virtual void PaintFocusBorder(gfx::Canvas* canvas) { }
// Called when any ancestor changes its size, asks the AutocompleteEditModel
// to close its popup.
@@ -149,7 +149,7 @@ class LocationBarView : public LocationBar,
void SetFont(const gfx::Font& font);
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
virtual gfx::Size GetMinimumSize();
@@ -204,7 +204,7 @@ class LocationBarView : public LocationBar,
void SetKeyword(const std::wstring& keyword);
std::wstring keyword() const { return keyword_; }
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
// The minimum size is just big enough to show the tab.
virtual gfx::Size GetMinimumSize();
@@ -12,7 +12,7 @@
#include <vsstyle.h>
#include <vssym32.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -62,7 +62,7 @@ class ListBackground : public views::Background {
}
virtual ~ListBackground() {}
virtual void Paint(ChromeCanvas* canvas, views::View* view) const {
virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
HDC dc = canvas->beginPlatformPaint();
RECT native_lb = view->GetLocalBounds(true).ToRECT();
gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb);
@@ -9,7 +9,7 @@
#include <vsstyle.h>
#include <vssym32.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
@@ -54,7 +54,7 @@ class FileDisplayArea : public views::View {
void SetFile(const FilePath& file_path);
// views::View overrides:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
@@ -104,7 +104,7 @@ void FileDisplayArea::SetFile(const FilePath& file_path) {
}
}
void FileDisplayArea::Paint(ChromeCanvas* canvas) {
void FileDisplayArea::Paint(gfx::Canvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
#include <algorithm>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/color_utils.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+4 -4
Ver Arquivo
@@ -11,8 +11,8 @@
#include <vector>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/file_util.h"
@@ -113,7 +113,7 @@ class FontDisplayView : public views::View {
int font_size() { return font_size_; }
// views::View overrides:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
@@ -175,7 +175,7 @@ void FontDisplayView::SetFontType(const std::wstring& font_name,
font_text_label_->SetText(displayed_text);
}
void FontDisplayView::Paint(ChromeCanvas* canvas) {
void FontDisplayView::Paint(gfx::Canvas* canvas) {
HDC dc = canvas->beginPlatformPaint();
RECT rect = { 0, 0, width(), height() };
gfx::NativeTheme::instance()->PaintTextField(
@@ -8,8 +8,8 @@
#include "chrome/browser/views/options/languages_page_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/file_util.h"
@@ -7,8 +7,8 @@
#include "chrome/browser/views/options/options_group_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/gfx/native_theme.h"
@@ -62,7 +62,7 @@ int OptionsGroupView::GetContentsWidth() const {
///////////////////////////////////////////////////////////////////////////////
// OptionsGroupView, views::View overrides:
void OptionsGroupView::Paint(ChromeCanvas* canvas) {
void OptionsGroupView::Paint(gfx::Canvas* canvas) {
if (highlighted_) {
COLORREF infocolor = GetSysColor(COLOR_INFOBK);
SkColor background_color = SkColorSetRGB(GetRValue(infocolor),
@@ -34,7 +34,7 @@ class OptionsGroupView : public views::View {
protected:
// views::View overrides:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);
+6 -6
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/sad_tab_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/gfx/size.h"
@@ -35,7 +35,7 @@ SadTabView::SadTabView() {
InitClass();
}
void SadTabView::Paint(ChromeCanvas* canvas) {
void SadTabView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setShader(skia::CreateGradientShader(0, height(),
kBackgroundColor,
@@ -50,12 +50,12 @@ void SadTabView::Paint(ChromeCanvas* canvas) {
canvas->DrawStringInt(title_, *title_font_, kTitleColor, title_bounds_.x(),
title_bounds_.y(), title_bounds_.width(),
title_bounds_.height(),
ChromeCanvas::TEXT_ALIGN_CENTER);
gfx::Canvas::TEXT_ALIGN_CENTER);
canvas->DrawStringInt(message_, *message_font_, kMessageColor,
message_bounds_.x(), message_bounds_.y(),
message_bounds_.width(), message_bounds_.height(),
ChromeCanvas::MULTI_LINE);
gfx::Canvas::MULTI_LINE);
}
void SadTabView::Layout() {
@@ -70,11 +70,11 @@ void SadTabView::Layout() {
int title_height = title_font_->height();
title_bounds_.SetRect(title_x, title_y, title_width_, title_height);
ChromeCanvas cc(0, 0, true);
gfx::Canvas cc(0, 0, true);
int message_width = static_cast<int>(width() * kMessageSize);
int message_height = 0;
cc.SizeStringInt(message_, *message_font_, &message_width, &message_height,
ChromeCanvas::MULTI_LINE);
gfx::Canvas::MULTI_LINE);
int message_x = (width() - message_width) / 2;
int message_y = title_bounds_.bottom() + kTitleMessageSpacing;
message_bounds_.SetRect(message_x, message_y, message_width, message_height);
+2 -2
Ver Arquivo
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
#define CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "base/basictypes.h"
#include "views/view.h"
@@ -32,7 +32,7 @@ class SadTabView : public views::View {
virtual ~SadTabView() {}
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
private:
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@
#include <algorithm>
#include <set>
#include "app/gfx/chrome_font.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/win_util.h"
#include "base/file_util.h"
+2 -2
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/star_toggle.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/app/chrome_dll_resource.h"
#include "grit/theme_resources.h"
@@ -33,7 +33,7 @@ bool StarToggle::GetState() const {
return state_;
}
void StarToggle::Paint(ChromeCanvas* canvas) {
void StarToggle::Paint(gfx::Canvas* canvas) {
PaintFocusBorder(canvas);
canvas->DrawBitmapInt(state_ ? *state_on_ : *state_off_,
(width() - state_off_->width()) / 2,
+1 -1
Ver Arquivo
@@ -42,7 +42,7 @@ class StarToggle : public views::View {
void SwitchState();
// Overriden from view.
void Paint(ChromeCanvas* canvas);
void Paint(gfx::Canvas* canvas);
gfx::Size GetPreferredSize();
virtual bool OnMousePressed(const views::MouseEvent& e);
virtual bool OnMouseDragged(const views::MouseEvent& event);
+3 -3
Ver Arquivo
@@ -6,7 +6,7 @@
#include <algorithm>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/text_elider.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
@@ -142,7 +142,7 @@ class StatusBubbleViews::StatusView : public views::Label,
void AnimateToState(double state);
void AnimationEnded(const Animation* animation);
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
BubbleStage stage_;
BubbleStyle style_;
@@ -318,7 +318,7 @@ void StatusBubbleViews::StatusView::SetStyle(BubbleStyle style) {
}
}
void StatusBubbleViews::StatusView::Paint(ChromeCanvas* canvas) {
void StatusBubbleViews::StatusView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setFlags(SkPaint::kAntiAlias_Flag);
+5 -5
Ver Arquivo
@@ -7,7 +7,7 @@
#include <windows.h>
#include <shellapi.h>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/favicon_size.h"
#include "app/gfx/icon_util.h"
#include "app/resource_bundle.h"
@@ -83,17 +83,17 @@ void TabIconView::Update() {
}
}
void TabIconView::PaintThrobber(ChromeCanvas* canvas) {
void TabIconView::PaintThrobber(gfx::Canvas* canvas) {
int image_size = g_throbber_frames->height();
PaintIcon(canvas, is_light_ ? *g_throbber_frames_light : *g_throbber_frames,
throbber_frame_ * image_size, 0, image_size, image_size, false);
}
void TabIconView::PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap) {
void TabIconView::PaintFavIcon(gfx::Canvas* canvas, const SkBitmap& bitmap) {
PaintIcon(canvas, bitmap, 0, 0, bitmap.width(), bitmap.height(), true);
}
void TabIconView::PaintIcon(ChromeCanvas* canvas,
void TabIconView::PaintIcon(gfx::Canvas* canvas,
const SkBitmap& bitmap,
int src_x,
int src_y,
@@ -125,7 +125,7 @@ void TabIconView::PaintIcon(ChromeCanvas* canvas,
dest_h, filter);
}
void TabIconView::Paint(ChromeCanvas* canvas) {
void TabIconView::Paint(gfx::Canvas* canvas) {
bool rendered = false;
if (throbber_running_) {
+4 -4
Ver Arquivo
@@ -39,13 +39,13 @@ class TabIconView : public views::View {
void set_is_light(bool is_light) { is_light_ = is_light; }
// Overriden from View
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual gfx::Size GetPreferredSize();
private:
void PaintThrobber(ChromeCanvas* canvas);
void PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap);
void PaintIcon(ChromeCanvas* canvas,
void PaintThrobber(gfx::Canvas* canvas);
void PaintFavIcon(gfx::Canvas* canvas, const SkBitmap& bitmap);
void PaintIcon(gfx::Canvas* canvas,
const SkBitmap& bitmap,
int src_x,
int src_y,
@@ -8,7 +8,7 @@
#include <set>
#include "app/animation.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
@@ -51,7 +51,7 @@ class DockView : public views::View {
return gfx::Size(DockInfo::popup_width(), DockInfo::popup_height());
}
virtual void PaintBackground(ChromeCanvas* canvas) {
virtual void PaintBackground(gfx::Canvas* canvas) {
SkRect outer_rect = { SkIntToScalar(0), SkIntToScalar(0),
SkIntToScalar(width()),
SkIntToScalar(height()) };
@@ -118,7 +118,7 @@ class DockView : public views::View {
}
private:
void DrawBitmapWithAlpha(ChromeCanvas* canvas, const SkBitmap& image,
void DrawBitmapWithAlpha(gfx::Canvas* canvas, const SkBitmap& image,
int x, int y) {
SkPaint paint;
paint.setAlpha(128);
+6 -6
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/tabs/dragged_tab_view.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/views/tabs/hwnd_photobooth.h"
@@ -148,7 +148,7 @@ void DraggedTabView::AnimationCanceled(const Animation* animation) {
///////////////////////////////////////////////////////////////////////////////
// DraggedTabView, views::View overrides:
void DraggedTabView::Paint(ChromeCanvas* canvas) {
void DraggedTabView::Paint(gfx::Canvas* canvas) {
if (!show_contents_on_drag_) {
PaintFocusRect(canvas);
} else if (attached_) {
@@ -185,13 +185,13 @@ gfx::Size DraggedTabView::GetPreferredSize() {
////////////////////////////////////////////////////////////////////////////////
// DraggedTabView, private:
void DraggedTabView::PaintAttachedTab(ChromeCanvas* canvas) {
void DraggedTabView::PaintAttachedTab(gfx::Canvas* canvas) {
renderer_->ProcessPaint(canvas);
}
void DraggedTabView::PaintDetachedView(ChromeCanvas* canvas) {
void DraggedTabView::PaintDetachedView(gfx::Canvas* canvas) {
gfx::Size ps = GetPreferredSize();
ChromeCanvas scale_canvas(ps.width(), ps.height(), false);
gfx::Canvas scale_canvas(ps.width(), ps.height(), false);
SkBitmap& bitmap_device = const_cast<SkBitmap&>(
scale_canvas.getTopPlatformDevice().accessBitmap(true));
bitmap_device.eraseARGB(0, 0, 0, 0);
@@ -236,7 +236,7 @@ void DraggedTabView::PaintDetachedView(ChromeCanvas* canvas) {
canvas->drawRect(rc, paint);
}
void DraggedTabView::PaintFocusRect(ChromeCanvas* canvas) {
void DraggedTabView::PaintFocusRect(gfx::Canvas* canvas) {
gfx::Size ps = GetPreferredSize();
canvas->DrawFocusRect(0, 0,
static_cast<int>(ps.width() * kScalingFactor),
+4 -4
Ver Arquivo
@@ -59,18 +59,18 @@ class DraggedTabView : public views::View,
virtual void AnimationCanceled(const Animation* animation);
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual gfx::Size GetPreferredSize();
// Paint the view, when it's attached to a TabStrip.
void PaintAttachedTab(ChromeCanvas* canvas);
void PaintAttachedTab(gfx::Canvas* canvas);
// Paint the view, when it's not attached to any TabStrip.
void PaintDetachedView(ChromeCanvas* canvas);
void PaintDetachedView(gfx::Canvas* canvas);
// Paint the view, when "Show window contents while dragging" is disabled.
void PaintFocusRect(ChromeCanvas* canvas);
void PaintFocusRect(gfx::Canvas* canvas);
// Resizes the container to fit the content for the current attachment mode.
void ResizeContainer();
+2 -2
Ver Arquivo
@@ -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 "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "base/gfx/point.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/tabs/hwnd_photobooth.h"
@@ -78,7 +78,7 @@ void HWNDPhotobooth::ReplaceHWND(HWND new_hwnd) {
}
void HWNDPhotobooth::PaintScreenshotIntoCanvas(
ChromeCanvas* canvas,
gfx::Canvas* canvas,
const gfx::Rect& target_bounds) {
// Our contained window may have been re-parented. Make sure it belongs to
// us until someone calls ReplaceHWND(NULL).
+4 -2
Ver Arquivo
@@ -8,7 +8,9 @@
#include "base/basictypes.h"
#include "base/gfx/rect.h"
class ChromeCanvas;
namespace gfx {
class Canvas;
}
namespace views {
class WidgetWin;
}
@@ -42,7 +44,7 @@ class HWNDPhotobooth {
// Paints the current display image of the window into |canvas|, clipped to
// |target_bounds|.
void PaintScreenshotIntoCanvas(ChromeCanvas* canvas,
void PaintScreenshotIntoCanvas(gfx::Canvas* canvas,
const gfx::Rect& target_bounds);
private:
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
#include "chrome/browser/views/tabs/tab.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+8 -8
Ver Arquivo
@@ -6,8 +6,8 @@
#include <limits>
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/chrome_font.h"
#include "app/gfx/canvas.h"
#include "app/gfx/font.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/win_util.h"
@@ -367,7 +367,7 @@ std::wstring TabRenderer::GetTitle() const {
////////////////////////////////////////////////////////////////////////////////
// TabRenderer, views::View overrides:
void TabRenderer::Paint(ChromeCanvas* canvas) {
void TabRenderer::Paint(gfx::Canvas* canvas) {
// Don't paint if we're narrower than we can render correctly. (This should
// only happen during animations).
if (width() < GetMinimumUnselectedSize().width())
@@ -555,7 +555,7 @@ void TabRenderer::AnimationEnded(const Animation* animation) {
////////////////////////////////////////////////////////////////////////////////
// TabRenderer, private
void TabRenderer::PaintTabBackground(ChromeCanvas* canvas) {
void TabRenderer::PaintTabBackground(gfx::Canvas* canvas) {
if (IsSelected()) {
// Sometimes detaching a tab quickly can result in the model reporting it
// as not being selected, so is_drag_clone_ ensures that we always paint
@@ -581,7 +581,7 @@ void TabRenderer::PaintTabBackground(ChromeCanvas* canvas) {
}
}
void TabRenderer::PaintInactiveTabBackground(ChromeCanvas* canvas) {
void TabRenderer::PaintInactiveTabBackground(gfx::Canvas* canvas) {
bool is_otr = data_.off_the_record;
// The tab image needs to be lined up with the background image
@@ -638,7 +638,7 @@ void TabRenderer::PaintInactiveTabBackground(ChromeCanvas* canvas) {
width() - tab_inactive.r_width, 0);
}
void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
void TabRenderer::PaintActiveTabBackground(gfx::Canvas* canvas) {
int offset = GetX(views::View::APPLY_MIRRORING_TRANSFORMATION) + 1;
ThemeProvider* tp = GetThemeProvider();
if (!tp)
@@ -674,7 +674,7 @@ void TabRenderer::PaintActiveTabBackground(ChromeCanvas* canvas) {
canvas->DrawBitmapInt(*tab_active.image_r, width() - tab_active.r_width, 0);
}
void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
void TabRenderer::PaintHoverTabBackground(gfx::Canvas* canvas,
double opacity) {
bool is_otr = data_.off_the_record;
SkBitmap left = skia::ImageOperations::CreateBlendedBitmap(
@@ -690,7 +690,7 @@ void TabRenderer::PaintHoverTabBackground(ChromeCanvas* canvas,
canvas->DrawBitmapInt(right, width() - tab_active.r_width, 0);
}
void TabRenderer::PaintLoadingAnimation(ChromeCanvas* canvas) {
void TabRenderer::PaintLoadingAnimation(gfx::Canvas* canvas) {
SkBitmap* frames = (animation_state_ == ANIMATION_WAITING) ?
waiting_animation_frames : loading_animation_frames;
int image_size = frames->height();
+6 -6
Ver Arquivo
@@ -92,7 +92,7 @@ class TabRenderer : public views::View,
private:
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Paint(gfx::Canvas* canvas);
virtual void Layout();
virtual void OnMouseEntered(const views::MouseEvent& event);
virtual void OnMouseExited(const views::MouseEvent& event);
@@ -117,11 +117,11 @@ class TabRenderer : public views::View,
void ResetCrashedFavIcon();
// Paint various portions of the Tab
void PaintTabBackground(ChromeCanvas* canvas);
void PaintInactiveTabBackground(ChromeCanvas* canvas);
void PaintActiveTabBackground(ChromeCanvas* canvas);
void PaintHoverTabBackground(ChromeCanvas* canvas, double opacity);
void PaintLoadingAnimation(ChromeCanvas* canvas);
void PaintTabBackground(gfx::Canvas* canvas);
void PaintInactiveTabBackground(gfx::Canvas* canvas);
void PaintActiveTabBackground(gfx::Canvas* canvas);
void PaintHoverTabBackground(gfx::Canvas* canvas, double opacity);
void PaintLoadingAnimation(gfx::Canvas* canvas);
// Returns the number of favicon-size elements that can fit in the tab's
// current size.
+2 -2
Ver Arquivo
@@ -5,7 +5,7 @@
#include "chrome/browser/views/tabs/tab_strip.h"
#include "app/drag_drop_types.h"
#include "app/gfx/chrome_canvas.h"
#include "app/gfx/canvas.h"
#include "app/gfx/path.h"
#include "app/l10n_util.h"
#include "app/os_exchange_data.h"
@@ -586,7 +586,7 @@ void TabStrip::UpdateLoadingAnimations() {
///////////////////////////////////////////////////////////////////////////////
// TabStrip, views::View overrides:
void TabStrip::PaintChildren(ChromeCanvas* canvas) {
void TabStrip::PaintChildren(gfx::Canvas* canvas) {
// Paint the tabs in reverse order, so they stack to the left.
Tab* selected_tab = NULL;
for (int i = GetTabCount() - 1; i >= 0; --i) {

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais