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

Unified Diff: ui/gfx/canvas_paint_win.cc

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/canvas_paint_win.h ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_paint_win.cc
diff --git a/ui/gfx/canvas_paint_win.cc b/ui/gfx/canvas_paint_win.cc
deleted file mode 100644
index 7d20fbcd1c88355358cfc574876625e9173b1df5..0000000000000000000000000000000000000000
--- a/ui/gfx/canvas_paint_win.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/canvas_skia_paint.h"
-#include "ui/gfx/rect.h"
-
-namespace gfx {
-
-CanvasSkiaPaint::CanvasSkiaPaint(HWND hwnd, HDC dc, const PAINTSTRUCT& ps)
- : hwnd_(hwnd),
- paint_dc_(dc) {
- memset(&ps_, 0, sizeof(ps_));
- ps_.rcPaint.left = ps.rcPaint.left;
- ps_.rcPaint.right = ps.rcPaint.right;
- ps_.rcPaint.top = ps.rcPaint.top;
- ps_.rcPaint.bottom = ps.rcPaint.bottom;
- Init(true);
-}
-
-CanvasSkiaPaint::CanvasSkiaPaint(HDC dc, bool opaque, int x, int y,
- int w, int h)
- : hwnd_(NULL),
- paint_dc_(dc) {
- memset(&ps_, 0, sizeof(ps_));
- ps_.rcPaint.left = x;
- ps_.rcPaint.right = x + w;
- ps_.rcPaint.top = y;
- ps_.rcPaint.bottom = y + h;
- Init(opaque);
-}
-
-CanvasSkiaPaint::~CanvasSkiaPaint() {
- if (!is_empty()) {
- skia::PlatformCanvas* canvas = platform_canvas();
- canvas->restoreToCount(1);
- // Commit the drawing to the screen
- skia::DrawToNativeContext(canvas, paint_dc_, ps_.rcPaint.left,
- ps_.rcPaint.top, NULL);
- }
-}
-
-gfx::Rect CanvasSkiaPaint::GetInvalidRect() const {
- return gfx::Rect(paint_struct().rcPaint);
-}
-
-void CanvasSkiaPaint::Init(bool opaque) {
- // FIXME(brettw) for ClearType, we probably want to expand the bounds of
- // painting by one pixel so that the boundaries will be correct (ClearType
- // text can depend on the adjacent pixel). Then we would paint just the
- // inset pixels to the screen.
- const int width = ps_.rcPaint.right - ps_.rcPaint.left;
- const int height = ps_.rcPaint.bottom - ps_.rcPaint.top;
-
- RecreateBackingCanvas(gfx::Size(width, height),
- gfx::win::GetDeviceScaleFactor(),
- opaque);
- skia::PlatformCanvas* canvas = platform_canvas();
-
- canvas->clear(SkColorSetARGB(0, 0, 0, 0));
-
- // This will bring the canvas into the screen coordinate system for the
- // dirty rect
- canvas->translate(
- -ps_.rcPaint.left / gfx::win::GetDeviceScaleFactor(),
- -ps_.rcPaint.top / gfx::win::GetDeviceScaleFactor());
-}
-
-} // namespace gfx
« no previous file with comments | « ui/gfx/canvas_paint_win.h ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698