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

Unified Diff: cc/content_layer_updater.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « cc/content_layer_updater.h ('k') | cc/delegated_renderer_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/content_layer_updater.cc
diff --git a/cc/content_layer_updater.cc b/cc/content_layer_updater.cc
deleted file mode 100644
index 82fa4a3c69894c2bbdd5b74c46de6e1f149ad178..0000000000000000000000000000000000000000
--- a/cc/content_layer_updater.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/content_layer_updater.h"
-
-#include "base/debug/trace_event.h"
-#include "base/time.h"
-#include "cc/debug/rendering_stats.h"
-#include "cc/layer_painter.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkRect.h"
-#include "third_party/skia/include/core/SkScalar.h"
-#include "ui/gfx/rect_conversions.h"
-#include "ui/gfx/rect_f.h"
-
-namespace cc {
-
-ContentLayerUpdater::ContentLayerUpdater(scoped_ptr<LayerPainter> painter)
- : painter_(painter.Pass()) {}
-
-ContentLayerUpdater::~ContentLayerUpdater() {}
-
-void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
- gfx::Rect content_rect,
- float contents_width_scale,
- float contents_height_scale,
- gfx::Rect* resulting_opaque_rect,
- RenderingStats* stats) {
- TRACE_EVENT0("cc", "ContentLayerUpdater::paintContents");
- canvas->save();
- canvas->translate(SkFloatToScalar(-content_rect.x()),
- SkFloatToScalar(-content_rect.y()));
-
- gfx::Rect layer_rect = content_rect;
-
- if (contents_width_scale != 1.f || contents_height_scale != 1.f) {
- canvas->scale(SkFloatToScalar(contents_width_scale),
- SkFloatToScalar(contents_height_scale));
-
- gfx::RectF rect = gfx::ScaleRect(
- content_rect, 1.f / contents_width_scale, 1.f / contents_height_scale);
- layer_rect = gfx::ToEnclosingRect(rect);
- }
-
- SkPaint paint;
- paint.setAntiAlias(false);
- paint.setXfermodeMode(SkXfermode::kClear_Mode);
- SkRect layer_sk_rect = SkRect::MakeXYWH(
- layer_rect.x(), layer_rect.y(), layer_rect.width(), layer_rect.height());
- canvas->drawRect(layer_sk_rect, paint);
- canvas->clipRect(layer_sk_rect);
-
- gfx::RectF opaque_layer_rect;
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
- painter_->Paint(canvas, layer_rect, &opaque_layer_rect);
- if (stats) {
- stats->totalPaintTime += base::TimeTicks::Now() - paint_begin_time;
- stats->totalPixelsPainted += content_rect.width() * content_rect.height();
- }
- canvas->restore();
-
- gfx::RectF opaque_content_rect = gfx::ScaleRect(
- opaque_layer_rect, contents_width_scale, contents_height_scale);
- *resulting_opaque_rect = gfx::ToEnclosedRect(opaque_content_rect);
-
- content_rect_ = content_rect;
-}
-
-} // namespace cc
« no previous file with comments | « cc/content_layer_updater.h ('k') | cc/delegated_renderer_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698