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

Unified Diff: ui/compositor/clip_transform_recorder.cc

Issue 1470123002: Split ClipTransformRecorder into {Clip,Transform}Recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize transformed to false. Created 5 years, 1 month 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/compositor/clip_transform_recorder.h ('k') | ui/compositor/compositor.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/clip_transform_recorder.cc
diff --git a/ui/compositor/clip_transform_recorder.cc b/ui/compositor/clip_transform_recorder.cc
deleted file mode 100644
index 8afd8be2cb6741e0987247d59c808d8b158ca021..0000000000000000000000000000000000000000
--- a/ui/compositor/clip_transform_recorder.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015 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 "ui/compositor/clip_transform_recorder.h"
-
-#include "base/logging.h"
-#include "cc/playback/clip_display_item.h"
-#include "cc/playback/clip_path_display_item.h"
-#include "cc/playback/display_item_list.h"
-#include "cc/playback/transform_display_item.h"
-#include "ui/compositor/paint_context.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/path.h"
-
-namespace ui {
-
-ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context)
- : context_(context), num_closers_(0) {
-}
-
-ClipTransformRecorder::~ClipTransformRecorder() {
- for (size_t i = num_closers_; i > 0; --i) {
- switch (closers_[i - 1]) {
- case CLIP_RECT:
- context_.list_->CreateAndAppendItem<cc::EndClipDisplayItem>();
- break;
- case CLIP_PATH:
- context_.list_->CreateAndAppendItem<cc::EndClipPathDisplayItem>();
- break;
- case TRANSFORM:
- context_.list_->CreateAndAppendItem<cc::EndTransformDisplayItem>();
- break;
- }
- }
-}
-
-void ClipTransformRecorder::ClipRect(const gfx::Rect& clip_rect) {
- auto* item = context_.list_->CreateAndAppendItem<cc::ClipDisplayItem>();
- item->SetNew(clip_rect, std::vector<SkRRect>());
- DCHECK_LT(num_closers_, arraysize(closers_));
- closers_[num_closers_++] = CLIP_RECT;
-}
-
-void ClipTransformRecorder::ClipPath(const gfx::Path& clip_path) {
- bool anti_alias = false;
- auto* item = context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>();
- item->SetNew(clip_path, SkRegion::kIntersect_Op, anti_alias);
- DCHECK_LT(num_closers_, arraysize(closers_));
- closers_[num_closers_++] = CLIP_PATH;
-}
-
-void ClipTransformRecorder::ClipPathWithAntiAliasing(
- const gfx::Path& clip_path) {
- bool anti_alias = true;
- auto* item = context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>();
- item->SetNew(clip_path, SkRegion::kIntersect_Op, anti_alias);
- DCHECK_LT(num_closers_, arraysize(closers_));
- closers_[num_closers_++] = CLIP_PATH;
-}
-
-void ClipTransformRecorder::Transform(const gfx::Transform& transform) {
- auto* item = context_.list_->CreateAndAppendItem<cc::TransformDisplayItem>();
- item->SetNew(transform);
- DCHECK_LT(num_closers_, arraysize(closers_));
- closers_[num_closers_++] = TRANSFORM;
-}
-
-} // namespace ui
« no previous file with comments | « ui/compositor/clip_transform_recorder.h ('k') | ui/compositor/compositor.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698