1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "cc/resources/ui_resource_request.h" 6 7 namespace cc { 8 9 UIResourceRequest::UIResourceRequest(UIResourceRequestType type, 10 UIResourceId id) 11 : type_(type), id_(id) {} 12 13 UIResourceRequest::UIResourceRequest(UIResourceRequestType type, 14 UIResourceId id, 15 const UIResourceBitmap& bitmap) 16 : type_(type), id_(id), bitmap_(new UIResourceBitmap(bitmap)) {} 17 18 UIResourceRequest::UIResourceRequest(const UIResourceRequest& request) { 19 (*this) = request; 20 } 21 22 UIResourceRequest& UIResourceRequest::operator=( 23 const UIResourceRequest& request) { 24 type_ = request.type_; 25 id_ = request.id_; 26 if (request.bitmap_) { 27 bitmap_ = make_scoped_ptr(new UIResourceBitmap(*request.bitmap_.get())); 28 } else { 29 bitmap_.reset(); 30 } 31 32 return *this; 33 } 34 35 UIResourceRequest::~UIResourceRequest() {} 36 37 } // namespace cc 38